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

Uploaded Source

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