Skip to main content

initialize LydiaMFcalc package

Reason this release was yanked:

deprecated

Project description

Welcome to Lydia's calculator!

Install and Import

You can install the LydiaMFcalc package with

python -m pip install -i https://test.pypi.org/simple/ 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

LydiaMFcalc-0.0.1.tar.gz (5.6 kB view hashes)

Uploaded Source

Built Distribution

lydiamfcalc-0.0.1-py2.py3-none-any.whl (5.0 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page