Skip to main content

A basic calculator

Project description

Calculator

Table of contents

  • Introduction
  • Installation
  • Usage
  • Technologies used
  • License

Introduction

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

  • Addition
  • Subtraction
  • Division
  • Multiplication
  • Modulus
  • N-th root
  • Exponent

It is an open source project with a public repository at https://github.com/TobAde/Calculator.

Installation

pypi_calculator requires python3 and can be installed via PYPI

$ pip install ecalculator-pkg-linda-oranya
$ pip install git+https://github.com/TobAde/Calculator.git

Usage

The calculator can be used for basic mathematical computation. The calculator has a memory that can reset itself to 0 and also stores previous values, except the memory is reset

Sample Code

from calculator import Calculator

cal = Calculator()
#intial calculator memory is zero

Addition

cal.add(7)

#returns 7

Subtraction

cal.subtract(3)

#returns 4
#because the memory was not reset, 2 was subtracted from previous value 7

Division

cal.divide(2)

#returns 2

Memory

cal.memory_value()

#returns 2

####Reset Memory

cal = cal.reset_memory()
cal.memory_value()
#returns 0

Technologies used

  • Python version: 3.8

License

MIT

It is a Free Software

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

calculator_tobade-0.0.1.tar.gz (3.8 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: calculator_tobade-0.0.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for calculator_tobade-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ce98ec7b9dfd909005bd95140dde9e7ac678556456a10cbcf533da5fece92231
MD5 9f242e5f90ca576de70cd40bade117a2
BLAKE2b-256 90b7f1651424f99811c193af5e4cc796b4a9963e91471e39e0d5e13a24cc5b36

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