Calculator with operations add, subtract, divide, multipy and root.
Project description
Calculator
Arithmetic calculator with operations add, subtract, divide, multipy and root.
Installation
pip install calculator_olu_ile
Usage
For example: Addition with package on IDLE
>>> from calculator_olu_ile.calculator import Calculator
>>> cal = Calculator()
>>> cal.add(2)
>>> print(cal.accum)
2
>>> cal.add(2)
>>> print(cal.accum)
4
For example: Subtraction with package on IDLE
>>> from calculator_olu_ile.calculator import Calculator
>>> cal = Calculator()
>>> cal.subtract(2)
>>> print(cal.accum)
-2
>>> cal.subtract(2)
>>> print(cal.accum)
-4
For example: Multiplication with package on IDLE
>>> from calculator_olu_ile.calculator import Calculator
>>> cal = Calculator()
>>> cal.multiply(2)
>>> print(cal.accum)
0
>>> cal.accum = 2
>>> cal.multiply(2)
>>> print(cal.accum)
4
For example: Divide with package on IDLE
>>> from calculator_olu_ile.calculator import Calculator
>>> cal = Calculator()
>>> cal.divide(2)
>>> print(cal.accum)
0.0
>>> cal.accum = 2
>>> cal.divide(2)
>>> print(cal.accum)
1.0
For example: Root with package on IDLE
>>> from calculator_olu_ile.calculator import Calculator
>>> cal = Calculator()
>>> cal.accum = 9
>>> cal.root(2)
>>> print(cal.accum)
3.0
For example: Is_input_valid with package on IDLE
>>> from calculator_olu_ile.calculator import Calculator
>>> cal = Calculator()
>>> print(cal.is_input_valid("text"))
False
>>> print(cal.is_input_valid(6))
True
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_olu_ile-0.2.1.tar.gz.
File metadata
- Download URL: calculator_olu_ile-0.2.1.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d456c71aa1639208a2b81b0634ce0b5cc4e5a6a977404dc08c05b2729378a10d
|
|
| MD5 |
6b1712f63a6a9f85255415472802825e
|
|
| BLAKE2b-256 |
5edb5a41186dd288b2b72fceb5363c4c4e8ddaf2435191ab5797faeb5d73022e
|
File details
Details for the file calculator_olu_ile-0.2.1-py3-none-any.whl.
File metadata
- Download URL: calculator_olu_ile-0.2.1-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbcf9d18042befb8c15619a6f08b9f51ec5868a6bad1fc677bfa0f95c167a2f1
|
|
| MD5 |
316d4dcfb00c531bde59effa02be18ec
|
|
| BLAKE2b-256 |
2b829930cf26e634677e2e6b1dde89465c69957060a32b9326d8a71c93b4aeb3
|