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(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.6.tar.gz (3.3 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.6-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: calcazhurb-0.0.6.tar.gz
  • Upload date:
  • Size: 3.3 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.6.tar.gz
Algorithm Hash digest
SHA256 8cca7aa93a0c1c9ae6cc5f2c2536d38395fc9b76cb6af0860824ecb49a5b3b38
MD5 72ae3570f2f135cde0a4c4b9f138b4d6
BLAKE2b-256 98f729f892d410d9db24f3e141fdf77ed6af4228fc5d05a7f1161aef469d4ee2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: calcazhurb-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 3.8 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d7193e3be848a780d74ea525d3ff6e250fa5296304500f82c63dc4601e36e277
MD5 4670f706911702ff2d550e64816450c4
BLAKE2b-256 f953a9c3f118c4436488b81f5dd35f182092f3952b1295c4f110c90c91d643b7

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