Skip to main content

A calculator which can perform simple algebra.

Project description

Calculator Package

The "Calculator" package is simple calculator with functions that able to perform these actions:

Installation

You can install this package using pip:

pip install -i https://test.pypi.org/simple/ calculator-riciokzz

Usage

After package installation you need to import Calculator from calculator_riciokzz.calculator.

from calculator_riciokzz.calculator import Calculator

Calculator have six main functions which can perform actions with value inside memory.

  • add
  • sub
  • multi
  • div
  • root
  • reset_memory

Create an instance for calculator and you are ready for some calculations.

calc = Calculator()

Functions usage examples:

Addition

calc.add(3) - will add 3 to memory and print Memory: 3.000.

calc.add(3)
Memory: 3.000

Subtraction

calc.sub(1) - will subtract 1 from memory and print Memory: 2.000.

Memory: 3.000
calc.sub(1)
Memory: 2.000

Multiplication

calc.multi(3) - will multiply memory by 3 and print Memory: 9.000.

Memory: 3.000
calc.multi(3)
Memory: 9.000

Division

calc.div(3) - will divide memory by 3 and print Memory: 3.000.

Memory: 9.000
calc.add(3)
Memory: 3.000

Root

calc.root(2) - will take (2) root of memory and print Memory: 3.000.

Memory: 9.000
calc.root(2)
Memory: 3.000

Reset

calc.reset_memory() - will clear memory and set it to default 0.

Memory: 3.000
calc.reset_memory()
Memory: 0.000

Testing

Testing with unittest, pyflakes and mypy show no warnings or errors.

============================== 2 passed in 0.02s ==============================
Success: no issues found in 1 source file

License

This project is licensed under the MIT License - see the 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

calculator_riciokzz-0.0.3.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

calculator_riciokzz-0.0.3-py3-none-any.whl (3.7 kB view hashes)

Uploaded 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