initialize LydiaMFcalc package
Project description
Welcome to Lydia's calculator!
Install and Import
You can install the LydiaMFcalc package with
python -m pip install LydiaMFcalc
Inside Python you can import the calculator module with
from LydiaMFcalc import Calc as c
General Use
For working in command line/script mode you can create an instance of the Calc(ulator) class in the Calc module by calling the class with a starting number for your calculations, e.g. 4.0.
a = c.Calc(4)
Operations with the next number, e.g. 9.6, can be called like this:
a.add_to(9.6)
The next operation is always based on the result of the previous operation, i.e. the calculator has a memory. The current result/memory value can be accessed by
a.result
The Calc module offers an interactive mode that can be started with e.g.
b = c.Interactive_Calc()
b.activate()
In this mode, you are asked to enter the numbers and the operations one after the other.
Operations
The Calc module supports the following mathematical operations which can be called in interactive mode by typing the operation sign (string) followed by an input request of the number to be applied and by the function name with the number to be applied in command line/script mode.
operation | interactive mode | class function |
---|---|---|
addition | + | add_to(number) |
subtraction | - | subtract_by(number) |
multiplication | * | multiply_by(number) |
division | / | divide_by(number) |
n-th root | rt | root_by(number) |
Reset Calculator
It is possible to reset the calculator memory/first operand: During interactive mode, enter R instead of an operation and the operand is set to zero. In command line/script mode type
a.reset(optional_number)
to reset the operand to an given value or to zero if left blank.
Leave Interactive Mode
If you want to quit the interactive mode, enter Q instead of an operation.
**~ Have fun! ~**
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
File details
Details for the file LydiaMFcalc-0.0.3.tar.gz
.
File metadata
- Download URL: LydiaMFcalc-0.0.3.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 403e73445eaa83d004828abde86a840c3be7720f3bbf6ec2a02e4aa1f77e85b3 |
|
MD5 | da205df62f9900dd5dac120530e46a2b |
|
BLAKE2b-256 | 975b844fa7a1f32e79ed58197a19c9d62e81bb2c1e0441e129674f7d526bd65d |
File details
Details for the file lydiamfcalc-0.0.3-py2.py3-none-any.whl
.
File metadata
- Download URL: lydiamfcalc-0.0.3-py2.py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f76c5efae7ca3aadd74679f038e39e6b4b66f2a3b79763da1dc46519297df4d |
|
MD5 | 00b4414789fff4c2e7d97d0ba13849eb |
|
BLAKE2b-256 | ec5e07f49b5d26adc249ecc370d5614819bc4a4ac0292c89738e6f95caf8da86 |