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 hashes)

Uploaded Source

Built Distribution

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

Uploaded 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