Skip to main content

A fully functional calculator by Sagar Kandel

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.1.tar.gz (4.3 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.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sagar_the_calculator-1.0.1.tar.gz
  • Upload date:
  • Size: 4.3 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.1.tar.gz
Algorithm Hash digest
SHA256 6560686e66b3f6ebe99131d7098abc7ff03e0bd26cff22f93c136195294d50c5
MD5 6d4e58b51026097f6eb3ffdb823b4486
BLAKE2b-256 845a78ca8f99c671017cf1f676a60d2396be26d47446c9626c006cc362a03613

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sagar_the_calculator-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 439e56992bcb99bf0903d802c815350a31d7e16ced489ec10aef5124bd6ea7ca
MD5 b5dadb22dcdc529bc7148a08b36c1aa0
BLAKE2b-256 28a4cd490e96947a3a0d2ef3ddb0848fa24c4f06544f32b597d7c86d0cbf6dde

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