Skip to main content

A simple calculator for arithmetic operations in python

Project description

PySimpleCalculator

This is a python package hosted on PYPI and can be used to perform basic functions on calculator such as;

  • ADDITION
  • SUBTRACTION
  • DIVISION
  • MULTIPLICATION
  • FINDING THE ROOT OF A NUMBER
  • FINDING THE POWER OF A NUMBER

Getting Started

Installation

pypi_calculator requires python3 and can be installed via PYPI

$ pip install git+https://github.com/Sherlocked-Blaire/PySimpleCalculator.git

Usage

The calculator can be used for basic operations.he calculator has a memory that caches the last result until it is reset. The cached result is used in the next computation if not reset.

Examples will be shown below

Sample Code

from SimpleCalculator import Calculator

calculator = Calculator()

Addition

>>> calculator.add(200)
200

Subtraction

subtract

>>> my_cal.subtract(54)
146

because the memory was not reset, 54 was subtracted from previous value 200

Division

>>> calculator.divide(2)
73

because the memory was not reset, 146 was divided by 2

Reset Memory

>>> calculator.reset()
>>> calculator.current_value()
0

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

pySimpleCalculator-0.0.1.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pySimpleCalculator-0.0.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file pySimpleCalculator-0.0.1.tar.gz.

File metadata

  • Download URL: pySimpleCalculator-0.0.1.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for pySimpleCalculator-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f5f78ecc879a4d55bb822bb562d1494521f32691974653d2553fbafda864fefa
MD5 56adc343e198b40ce3730ea2e982fbf3
BLAKE2b-256 c2647b26f310da15d6ba92bb5b84663dca8379d0eafaf7322879c893497fa7f6

See more details on using hashes here.

File details

Details for the file pySimpleCalculator-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pySimpleCalculator-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for pySimpleCalculator-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0d41c4d2f57526ed4bbe4c3c00c695de12f92805e14693f3fe7637a5c420f557
MD5 f8fecfd2a5bdc9600bc5f7dec90641f3
BLAKE2b-256 540c86a39c4bf4fc326b867324c01d125d82728e68aac3e805539901f83b79df

See more details on using hashes here.

Supported by

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