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_turing_IS.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.0.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.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: calculator_turing_is-1.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 17f7365ccfa3ad3d0977c265217c781c394d6082fdaceb77d84ea52f59691c37
MD5 24ed8da2acd8fef179cc0c932fc513fc
BLAKE2b-256 19177a9e4e8729ee1e2ea7ee0f0f06d8f80f458ea708581aee007dddcdc138ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for calculator_turing_is-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f5c1054671df7e4df071a5d19e256a5cd1d3c7786309e58d92883d2343cbfa7
MD5 4380f8b1a2dd12f30c6d77040ada408a
BLAKE2b-256 5e133d019db163f6b0a9aa1c9938ab066f49ce658f5364afacfa93769751ce90

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