Skip to main content

Basic operations calculator

Project description

Description

calculator.py includes a class 'Calculator' which performs basic calculator operations

Installation

pip install anirtic_calculator

Importing a package

from anirtic_calculator.calculator import Calculator

Attributes

memory : float Calculator memory

Methods

add(number): Takes the number and adds it to calculator memory

subtract(number): Takes the number and subtracts it from calculator memory

multiply(number): Multiplies calculator memory by a given number

divide(number): Divides calculator memory by a given number

root(number): Takes the n root of calculator memory

reset(): Resets calculator memory

Example

from anirtic_calculator import calculator
Calculator.add(2)
2.0

Calculator.multiply(3)
6.0

Calculator.divide(3)
2.0

Calculator.root(2)
1.4142135623730951

Calculator.reset()
0.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

anirtic_calculator-0.0.4.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

anirtic_calculator-0.0.4-py3-none-any.whl (3.5 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