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:
- Add numbers;
- Subtract numbers;
- Multiply numbers;
- Divide numbers;
- 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:
- Run python (i.e. macOS shell enter: % python)
- Enter: from calculator_kazbad import calculator
- 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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a5d4fa744063b0f42223f781a490410121be1e16b730007b778c498a74d8b16 |
|
MD5 | b44c505a28b174425bfeec4d89980333 |
|
BLAKE2b-256 | e37bab73e564b3b9d111941b6a017173b072fd2ac90f6601fe45c58fb9d18e06 |
File details
Details for the file calculator_kazbad-0.2-py3-none-any.whl
.
File metadata
- Download URL: calculator_kazbad-0.2-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69ad3b48007872f90dd5172d13f48bea259b96b378891c72b1065e58ad515e28 |
|
MD5 | 39a47412e7abbb3f5ea1701421c0751e |
|
BLAKE2b-256 | d062dff41b49a88c4bfb6edc111e547a6ee536a392373351f0c1ee741a129a07 |