Skip to main content

A simple Calculator package

Project description

About Calculator

This Calculator is created as my very first project for Turing College, Sprint 1. 08 February, 2023.

Functionality

This is a Calculator that can be used to:

  1. Add numbers;
  2. Subtract numbers;
  3. Multiply numbers;
  4. Divide numbers;
  5. Take nth root of a positive numbers.

Calculator has its own memory which can be reset, like in a pocket calculator.

Calculator has user-friendly command line interface, where possible commands are outlined, and calculation results are displayed.

Instalation

This package is uploaded to PiPI and can be installed using pip command: pip install calculator_kazbad

To start calculating:

  1. Run python (i.e. macOS shell enter: % python)
  2. Enter: from calculator_kazbad import calculator
  3. Calculator should start running and greet you with list of commands.

Example

Firs command line prompt outlines the possible operations and user inputs to utilise it. Calculations start with internal memory value of 0. For example:

input: + input: 1 output: Answer: 1.0

Calculations can continue with a new internal memory value (continuing from previous example):

input: + input: 1 output: Answer: 2.0

If memory value is 0, and multiplication of division operation is chosen, user is asked to input new value, for example:

input: Answer: 0.0 input: * input/output: Type a new multiplier: 10 input/output: Type a multiplicand: 5 output: Answer: 50.0

If n-th root operation is attempted with negative memory value, user is asked to input new value, for example:

Answer: -60.0 n Type a new positive radicand: 9 Type a root index: 2 Answer: 3.0

Testing

Calculator methods was tested using 'pytest' package and it passed all 6 tests. Additionally this package has test.py file to repeat tests independently.

Feedback

Feedback and improvement suggestions on this package is appreciatd. You can create a pull request or open an issue in GitHub.

License

MIT

Project details


Release history Release notifications | RSS feed

This version

0.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

calculator_kazbad-0.2.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

calculator_kazbad-0.2-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file calculator_kazbad-0.2.tar.gz.

File metadata

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

File hashes

Hashes for calculator_kazbad-0.2.tar.gz
Algorithm Hash digest
SHA256 7a5d4fa744063b0f42223f781a490410121be1e16b730007b778c498a74d8b16
MD5 b44c505a28b174425bfeec4d89980333
BLAKE2b-256 e37bab73e564b3b9d111941b6a017173b072fd2ac90f6601fe45c58fb9d18e06

See more details on using hashes here.

File details

Details for the file calculator_kazbad-0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for calculator_kazbad-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 69ad3b48007872f90dd5172d13f48bea259b96b378891c72b1065e58ad515e28
MD5 39a47412e7abbb3f5ea1701421c0751e
BLAKE2b-256 d062dff41b49a88c4bfb6edc111e547a6ee536a392373351f0c1ee741a129a07

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