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 ##########
Usage
From calculator module import functions to calculate simple algebra. Calculator have six main functions which can perform actions with value inside memory.
from calculator import add, sub, multi, div, root, reset_memory
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
To run the tests, use the following command:
python test_calculator.py
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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 222f6f42ca017ee9e5f5afa48af19d0aaaf3865717b8da1c8cce079ede2df694 |
|
MD5 | 39aeeecb424ae39f912010c4e7b11293 |
|
BLAKE2b-256 | 6b8c39d6f659ab18ae5d69a6bd2b073ffb57ec41b32af7e9e94fa6435647f957 |
Hashes for calculator_riciokzz-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab7e5b376c6bc52cb870554370d5faff7fe47be36cfa93d0f59e5eb5dfc5c18f |
|
MD5 | e699a0a0afc098ccb1ca8e3af8c6ebeb |
|
BLAKE2b-256 | c5644cb1868588431bf1d03c85557182ef0201123d337ace9655d4cdbb54459c |