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

Uploaded Source

Built Distribution

anirtic_calculator-0.0.4-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file anirtic_calculator-0.0.4.tar.gz.

File metadata

  • Download URL: anirtic_calculator-0.0.4.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.7

File hashes

Hashes for anirtic_calculator-0.0.4.tar.gz
Algorithm Hash digest
SHA256 19ca10955c22a992f023e65a640816ce79807075418d775ddae26d51a04f2aef
MD5 37475027bad91ed7d8696d5dac1a0b14
BLAKE2b-256 c66a53dd7b64a2048f6d29755c05d2d81894ed0152011552c3a06ae0488d8c1e

See more details on using hashes here.

File details

Details for the file anirtic_calculator-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for anirtic_calculator-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 968d88a55b7e29cbd52b1cb40dbb1eba3b2d2f9f7423501cf383d504cc3dcffb
MD5 899144ed8a1a3f86ac254e6e8910c49b
BLAKE2b-256 b71c9b1cd6ed22bf0a20e6b73cc58393da3c82e13293df3f57eff7eb1b8f4e69

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