Skip to main content

Simple calculator package

Project description

calculator_102

calculator_102 is a Python package that contains functions for simple calculation.

Installation

Use the package manager pip to install calculator_102.

pip install calculator_102

Usage

Calculator has its own memory, meaning it can manipulate its starting number 0 until it is reset.

Features:

>>> calculator = Calculator()
  • memory

    shows current value in memory:

# Memory value = 50
>>> calculator.memory()
50
  • add

    adds number to memory value:

# Memory value = 0
>>> calculator.add(2)
2
  • subtract

    subtracts number from memory value:

# Memory value = 10
>>> calculator.subtract(4)
6
  • multiply

    multiplies memory value by number:

# Memory value = 10
>>> calculator.multiply(2)
20
  • divide

    divides memory value by number:

# Memory value = 10
>>> calculator.divide(2)
5.0
  • n_root

    finds the root of memory value by the inputted number:

# Memory value = 100
>>> calculator.n_root(2)
10.0
  • reset

    resets memory value to its initial value - 0:

# Memory value = 100
>>> calculator.reset()
# Memory value = 0

License

MIT

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_102-0.1.7.tar.gz (2.5 kB view hashes)

Uploaded Source

Built Distribution

calculator_102-0.1.7-py2.py3-none-any.whl (2.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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