Skip to main content

A fully functional command-line calculator by Sagar

Project description

Sagar's Calculator 🧮

A simple, fully functional command-line calculator by Sagar.

Installation

pip install sagar_the_calculator

Usage

As a command-line tool

sagar-calc

As a Python library

from sagar_the_calculator import add, subtract, multiply, divide, power, modulo, square_root

print(add(10, 5))         # 15
print(subtract(20, 8))    # 12
print(multiply(6, 7))     # 42
print(divide(100, 4))     # 25.0
print(power(2, 10))       # 1024
print(modulo(17, 5))      # 2
print(square_root(144))   # 12.0

Interactive mode

>>> 10 + 5
  = 15.0
>>> sqrt 144
  = 12.0
>>> quit
Goodbye! 👋

Supported Operations

Operation Symbol Example
Addition + 10 + 5
Subtraction - 20 - 8
Multiply * 6 * 7
Division / 100 / 4
Power ** 2 ** 10
Modulo % 17 % 5
Square root sqrt sqrt 144

License

MIT License — see LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sagar_the_calculator-1.0.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sagar_the_calculator-1.0.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file sagar_the_calculator-1.0.0.tar.gz.

File metadata

  • Download URL: sagar_the_calculator-1.0.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for sagar_the_calculator-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7e6c52f2d617cb692daa8ff1cbc4246811a573cfd803aa44d401f4a9d05caf84
MD5 bcfa6e1811c14af41b386d1b2338ab30
BLAKE2b-256 e8d93446c00ada3108ded14f5ca9bee1b9ba8fad930e83388153ec39d9398c39

See more details on using hashes here.

File details

Details for the file sagar_the_calculator-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sagar_the_calculator-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a5f9ba0bd4c27555fb11b63e44a01a4b76dfb0c42db3136234d3d8d0dd186bf5
MD5 525ee1c9ffd9df099272d1c85829cb7c
BLAKE2b-256 1929a01540b425af1cf2d0dd65d15e4f0a45062cdd9eef22373237cf749089c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page