Calculator class package with basic functions
Project description
#Calculator
Create instances of calculator as a class in python.
###Functions included:
- add - sums calculator memory with provided value.
- minus - subtracts the entered value from calculator memory.
- multiply - multiplies calculator memory by the input value.
- divide - devides the calculator memory by the input value.
- root - takes n root from the calculator memory value (square root is taken when no input given).
- reset - Resets calculator instance memory to zero.
Each function adjusts the calculator memory, as well as returns the new value.
###Installation
pip install calculator_rm==0.0.2
###Usage
import calculator
calc_obj = Calculator() # creates an object instance
calc_obj.add(1) # adds 1 to the instance
calc_obj.minus(2) # subtracts 2 from the instance
calc_obj.multiply(3) # multiplies the instnace by 3
calc_obj.divide(4) # divides the instnace by 4
calc_obj.root() # returns square root of the instance
calc_obj.root(5) # returns root 5 of the instance
calc.obj.reset() # resets instance back to zero.
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
calculator_rm-0.0.2.tar.gz
(2.6 kB
view hashes)
Built Distribution
Close
Hashes for calculator_rm-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 768119985feca62e966464b38892ef7f14c23761eb4b3fa0264d10635b42323d |
|
MD5 | 3b65253082ea148a66b350154d8c601e |
|
BLAKE2b-256 | 7baf5f4dd6f0c8827ad1f93123090a456ac4c34d654fb2d290ecb579ac4f81b4 |