Skip to main content

A Calculator package

Project description

Calculator

This package has a Calculator class that perfroms different math operations, such as:

- addition
- subtraction
- multiplication
- division
- taking (n) root of a number
- reset memory to 0

Calculator class has following attributes:

- number - current number in the calculator
            that we can manipulate with

Also, it includes methods:

- add(other_number) - adds to our number
other number and returns the result
- subtract(other_number) - subtracts from our number
other number and returns the result
- multiply(other_number) - multiplies our number by
other number and returns the result
- divide(other_number) - divides our number by
other number and returns the result
- nth_root(other_number) - takes n-th root from
our number and returns the result
- reset() - sets number to 0 and returns
the result

Installation

pip install calcazhurb

Usage

Create an object

>>> from calcazhurb import calculator
>>> calc = calculator.Calculator(15.5)

Add some number

>>> calc.add(5.0)
20.5

Reset the number to 0

>>> calc.reset()
0.0

Subtract a number

>>> calc.subtract(10.5)
-10.5

Multiply a number

>>> calc.multiply(-10.0)
105.0

Take nth root of a number

>>> calc.nth_root(2)
10.246950765959598

License

MIT

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

calcazhurb-0.0.4.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

calcazhurb-0.0.4-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for calcazhurb-0.0.4.tar.gz
Algorithm Hash digest
SHA256 a1d3cc09b097b5812f3e95592f199491a9ddcf755f7c317795e4ae6e9e5d27c2
MD5 ba2327801e77dc5db34537df930ab387
BLAKE2b-256 53793e872d58b5f410e5bae9a25f1306fdd2b13eed237f9edcd1eb461698d4d7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: calcazhurb-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for calcazhurb-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8075cdb478c9fe9ed043c438ee566a21bdd2993e2d48aab251df6370cd3ff8b4
MD5 1c957fbd6d723b10bd4bcd681c8832a8
BLAKE2b-256 3287a38d0d8f90a854b9935734e1f430c8fe3f974164a4ce0c01ebba8a1292f4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page