Skip to main content

Very simple calculator

Project description

Basic calculator

This is a calculator project for basic math functions.
Implemented methods:
addition
subtraction
multiplication
division
nth-root ((n) root of a number)
reset memory

Installation

pip install basic-math-calculator

from calculator.calculator import Calculator

Usage

Result is stored and overwritten in memory until reset() method is ran.

Calculation methods can take either one or two arguments (in addition to self). If only one arguments is given calculations will be performed with memory value (latest result), otherwise calculations will be performed between two arguments and memory value will be overwritten.

For example:

>>> calc = Calculator()
>>> calc.addition(4, 5)
9
>>> calc.addition(10)
19
>>> calc.multiplication(2)
38
>>> calc.multiplication(2, 5)
10
>>> calc.reset()
0

License

This project is licensed under the terms of the MIT license

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

basic_math_calculator-0.1.0-py2.py3-none-any.whl (3.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file basic_math_calculator-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for basic_math_calculator-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a77b7a87f9bf5d73d4ac6c29e3a30d0ad4ab362ae778216c8b231392b26c2408
MD5 21102f463ab5191d36ea709f1777c703
BLAKE2b-256 268de7a9a1ae02ff952a274c83f8aaec335be7ada4235648b113e2880c9d21b7

See more details on using hashes here.

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