Skip to main content

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

Release files for basic_math_calculator 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for basic_math_calculator 0.1.0
File Interpreter ABI Platform
basic_math_calculator-0.1.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Release files / basic_math_calculator-0.1.0-py2.py3-none-any.whl

Download URL basic_math_calculator-0.1.0-py2.py3-none-any.whl
Size 3.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
a77b7a87f9bf5d73d4ac6c29e3a30d0ad4ab362ae778216c8b231392b26c2408
BLAKE2b-256 checksum
How to use checksums
268de7a9a1ae02ff952a274c83f8aaec335be7ada4235648b113e2880c9d21b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.27.1

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page