Very simple calculator
Project description
Basic calculator
This is a calculator project for basic math functions.
Implemented methods:
addition
subtraction
multiplication
division
nth-root ((n) root of a number)
reset memory
Installation
pip install basic-math-calculator
from calculator.calculator import Calculator
Usage
Result is stored and overwritten in memory until reset() method is ran.
Calculation methods can take either one or two arguments (in addition to self). If only one arguments is given calculations will be performed with memory value (latest result), otherwise calculations will be performed between two arguments and memory value will be overwritten.
For example:
>>> calc = Calculator()
>>> calc.addition(4, 5)
9
>>> calc.addition(10)
19
>>> calc.multiplication(2)
38
>>> calc.multiplication(2, 5)
10
>>> calc.reset()
0
License
This project is licensed under the terms of the MIT license
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 Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file basic_math_calculator-0.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: basic_math_calculator-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.27.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a77b7a87f9bf5d73d4ac6c29e3a30d0ad4ab362ae778216c8b231392b26c2408
|
|
| MD5 |
21102f463ab5191d36ea709f1777c703
|
|
| BLAKE2b-256 |
268de7a9a1ae02ff952a274c83f8aaec335be7ada4235648b113e2880c9d21b7
|