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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for calculator_riciokzz-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfe5c9335f86f13379ba84559831bf154afd6d3624a07269f16fa423b1929b02 |
|
MD5 | 126a9bfd5472f803e21e39dd7d7048c7 |
|
BLAKE2b-256 | c4fb89d1a143ba8753fea6ba9c72df9aebe561bb009222355b01ae0014207093 |
Hashes for calculator_riciokzz-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8fd99e661d05da53b75bb3054f594f221cf609c6c51d3c88171a8c2cbb5ee89 |
|
MD5 | f769e7519f4864f9a92cc1152a892912 |
|
BLAKE2b-256 | dc8c64481d1ae9656f9fc27f51969c1544aa71f265bc4e2970695b2c2bd53f1d |