A simple python package that allows users to perform the most basic arithmetic functions.
Project description
CalclculatorPackage
Description
'Calculator' is a simple python package that allows users to perform the most basic arithmetic functions.
Available functions:
- Addition (
.add(n)
) - Subtraction (
.subtract(n)
) - Multiplication (
.multiply(n)
) - Division (
.divide(n)
) - N Root (
.n_root(n)
) - Reset memory (
.reset()
)
Prerequisites
- Python
- Git
Installation
Package can be installed by running the following command:
pip install CalculatorPackageTuringRokasSertvytis==1.1
Package could also be imported more elegantly by just running the following command in the command line
pip install git+https://github.com/TuringCollegeSubmissions/rsertv-DWWP.1#egg=Calculator
,but since the project is currently in a private GitHub directory, this method will not work.
How to use
After successfully importing the package to the project, a Calculator()
object must be created by running the following command:
calculator = Calculator()
.
Now to use the calculator user can run the aforementioned commands as such:
calculator.add(5) # OUTPUT: 0 + 5 = 5
calculator.subtract(2) #OUTPUT: 5 - 2 = 3
calculator.multiply(9) #OUTPUT: 3 * 9 = 27
calculator.divide(3) #OUTPUT: 27 / 3 = 9
calculator.nRoot(2) #OUTPUT: 9 ^ (1/2) = 3
calculator.reset() #OUTPUT: Memory cleared
Tests
Package also includes tests which are located inside tests/calculator_test.py. One of the ways to run the test is to simply run calculator_test.py
from command line when inside the test directory.
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 CalculatorPackageTuringRokasSertvytis-1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fe57794faeb344868babbdb8771f3a8710d3b4164bbcdff11e7a8b06709615c |
|
MD5 | 18822bb1e25f97e2765c0bf23dbe3342 |
|
BLAKE2b-256 | d5b3d8470cebb5d6d4bed5119c3fa1888bdc5bc415b027b1694283bbe76759dd |
Hashes for CalculatorPackageTuringRokasSertvytis-1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a144e7e69becee9c556c9cdd5924c30fd2c004ae8884a79f8d80681ba4e18643 |
|
MD5 | 9652c585cafd005436907f6d6d263e7a |
|
BLAKE2b-256 | 85a8ea30699e77ac4ce1ff5e99563b2cd30a9d5684b23474cf5dc334af77b94d |