A Calculator package
Project description
Calculator
This package has a Calculator class that perfroms different math operations, such as:
- addition
- subtraction
- multiplication
- division
- taking (n) root of a number
- reset memory to 0
Calculator class has following attributes:
- number - current number in the calculator
that we can manipulate with
Also, it includes methods:
- add(other_number) - adds to our number
other number and returns the result
- subtract(other_number) - subtracts from our number
other number and returns the result
- multiply(other_number) - multiplies our number by
other number and returns the result
- divide(other_number) - divides our number by
other number and returns the result
- nth_root(other_number) - takes n-th root from
our number and returns the result
- reset() - sets number to 0 and returns
the result
Installation
pip install calcazhurb
Usage
Create an object
>>> from calcazhurb import Calculator
>>> calc = Calculator(15.5)
Add some number
>>> calc.add(5.0)
20.5
Reset the number to 0
>>> calc.reset()
0.0
Subtract a number
>>> calc.subtract(10.5)
-10.5
Multiply a number
>>> calc.multiply(-10.0)
105.0
Take nth root of a number
>>> calc.nth_root(2)
10.246950765959598
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
calcazhurb-0.0.5.tar.gz
(3.2 kB
view details)
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 calcazhurb-0.0.5.tar.gz.
File metadata
- Download URL: calcazhurb-0.0.5.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
308ed9564344db87ada8576163ee683dc793592f389772e7d3f11b4519df6e52
|
|
| MD5 |
241068d4672fd5354bfc2648a4545645
|
|
| BLAKE2b-256 |
4774deb23816203ec130328f2c2fee0e1c502deeaf8657aed028a95fa4a9af61
|
File details
Details for the file calcazhurb-0.0.5-py3-none-any.whl.
File metadata
- Download URL: calcazhurb-0.0.5-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4f287cee2d58779956f5e3bb65c671701a957d6856517b4f0f95909ea74a7b3
|
|
| MD5 |
48a76e8f99f82ce7a63cb90cfc2d8b20
|
|
| BLAKE2b-256 |
6977c2246698ead0db1c338dc046d573956e224ef7597b5d4f93226319bab58b
|