Simple calculator module, supporting addition, subtraction, multiplication, division and taking nth root.
Project description
calculator-papartynas
Basic Python calculator for Turing College Data Science program's module #1, sprint #1. Supports floating point number addition, subtraction, multiplication, division and taking nth root. Keeps track of the current calculation result.
Installation
python3 -m pip install calculator_papartynas
Examples
Import calculator module:
from calculator-papartynas.calculator import Calculator
Perform basic mathematical operations:
print(Calculator().add(2).subtract(1).multiply_by(8).divide_by(2).take_nth_root(2))
# outputs: ((0 + 2 - 1) × 8 / 2) ^ 0.5 = 2.0
Get calculation result:
print(Calculator().add(42).result) # outputs: 42
Reset memory:
print(Calculator().add(1).reset_memory().add(1)) # outputs: 0 + 1 = 1
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
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 calculator_papartynas-1.tar.gz.
File metadata
- Download URL: calculator_papartynas-1.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c541d0df4ca2ba23352692f626c6ad3db9c90d0c90ca355ebf86079efeb20ef2
|
|
| MD5 |
6f7c264e3b3900ca7b57ab96f150213a
|
|
| BLAKE2b-256 |
5dd9c80c12ee286730455889de5d75fdde4fbd53299cad5d765a8299d643f999
|
File details
Details for the file calculator_papartynas-1-py3-none-any.whl.
File metadata
- Download URL: calculator_papartynas-1-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d290d733b75df11dfaf6926c3462187aa3f9b94bcb966e9e2da8dd5dab5c3a4d
|
|
| MD5 |
cb2c5f8f9ce7ed89d655dc366a2bcdbe
|
|
| BLAKE2b-256 |
ed565574a0eb48f5cc3e59682596474bafc84eb908fbfb83be73c7103f9996a9
|