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.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
Take nth root of a number
>>> calc.nth_root(2)
10.246950765959598
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.3.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.3.tar.gz.
File metadata
- Download URL: calcazhurb-0.0.3.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 |
8f9b17e74e5315777952bf88b9e817b61a1c532318a076f384e42cfa35f980bc
|
|
| MD5 |
832d78d03ca81e56b0632612fcd5a2d2
|
|
| BLAKE2b-256 |
f16144b77e77452a27a68073e9321e1481bfc2a6886d79bc0363feca41d8e774
|
File details
Details for the file calcazhurb-0.0.3-py3-none-any.whl.
File metadata
- Download URL: calcazhurb-0.0.3-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 |
365b70389c7367317ab4d37779dd23ca8d020c3c59992186f99beccc9cd395a2
|
|
| MD5 |
94ed332cf6ad54b5b457c66f47143260
|
|
| BLAKE2b-256 |
7a9085634e3455f1e10da1fdccb45b77471cf9c3ab210ac18abdf66b81a7b74f
|