Skip to main content

A simple calculator package for basic arithmetic operations

Project description

Calculator project | Module 1 Sprint 2

A simple Python package for performing basic arithmetic operations:

-Addition
-Subtraction
-Finding the nth root

Installation

You can install this package directly from PyPI using pip:

pip install calculator_turing_IS

Usage

Calculator class has methods like below:

  • add(number) Adds the given number to the stored result.
  • sub(number) Subtracts the given number from the stored result.
  • root(number) Computes the nth root of the result. (Cannot be zero or an even root of a negative number)
  • reset() Resets the result to 0.

-if you print object then you will see output of the last result

Example of using after installation:

from calculator.calculator import Calculator

calc = Calculator()

print(calc.add(10))  # Output: 10
print(calc.sub(2))  # Output: 10
print(calc.root(3))  # Output: "2"
print(calc) # Output: "2"
calc.reset()
print(calc) # Output: "0"

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

calculator_turing_is-1.0.1.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

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

calculator_turing_is-1.0.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: calculator_turing_is-1.0.1.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.12.3 Windows/10

File hashes

Hashes for calculator_turing_is-1.0.1.tar.gz
Algorithm Hash digest
SHA256 f5e0c35d89fe461295c7648596943665cef344c73a3ed6189563fd953323373a
MD5 0007144dc433bf2aa692eec8f059b3b6
BLAKE2b-256 5b12a57edaee8b13e60f872c7c967023a2c1cd656c0e0bcd0f5bb26c0eed65d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for calculator_turing_is-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dced3d8df9cde865bdcf4255f88ee06e422ccefe924e77159ee5e73e38a4d118
MD5 b9ef0feda0a987748d108ae53179ec1e
BLAKE2b-256 2a8c51a8ced1bbd8f83dc49c05359c4a9a8398d577ff97271a182f5a99262c8c

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