Skip to main content

Calculator

This calculator package can perform addition, subtraction, multiplication, and division, as well as taking a (n) root of a number and also resetting its memory.

For each operation, it takes only one input number and combines it with the current value in its own memory, which can be reset to zero.

The technology stack for this project includes Python for building the package, Docker for containerizing the package, and Pytest for testing the package.


Features

  • Addition: The input value is added to the memory value.
  • Subtraction: The input value is subtracted from the memory value.
  • Multiplication: The input value is multiplied by the memory value.
  • Division: The input value is divided by the memory value.
  • Root: The input value root of the memory value is returned.
  • Reset: The memory value is reset to zero.

Installation

You can run any of the commands below to install the package.

To install the package from PyPI

$ pip install calculatorvadim

To install from github

$ pip install git+https://github.com/vadimiljin/calculatorvadim.git

To get the calculator image from docker hub

$ docker pull iljinvadim/calculatorvadim

Usage

Usage examples for each method are given below.

>>> from calculatorvadim import Calculator
>>> calculator = Calculator()
>>> calculator.add(4)
4
>>> calculator.subtract(2)
2
>>> calculator.multiply(12)
24
>>> calculator.divide(3)
8.0
>>> calculator.root(3)
2.0
>>> calculator.reset()
0

Testing

$ pytest

License

This project is licensed under the terms of the MIT license


Author

Vadim Iljin

Release files for calculatorvadim 0.0.4

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

Source distribution (sdist)

Source distribution for calculatorvadim 0.0.4
File Size Uploaded
calculatorvadim-0.0.4.tar.gz 3.4 kB Details

Built distribution (wheel)

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

Total release size: 6.8 kB

Release files / calculatorvadim-0.0.4.tar.gz

Download URL calculatorvadim-0.0.4.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3951579d9c16d37134d78d08640e611500a51cfc205963156cfe8a35a1457eee
BLAKE2b-256 checksum
How to use checksums
e00fb0686c68eba59cc7421063ce1ee28a33eb193f94b981a1331d8c0a61f196
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.27.1

Release files / calculatorvadim-0.0.4-py2.py3-none-any.whl

Download URL calculatorvadim-0.0.4-py2.py3-none-any.whl
Size 3.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
aff44e8e434fdd8d37ed424d086a5758793f34839cedf673fd16b8e8592843c3
BLAKE2b-256 checksum
How to use checksums
71ba72ca35cac2badcdac9bb641ccc5a39625f24abef78216f2d7560c663ae1c
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.0.4 This release

2 release files

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