Skip to main content

Calculator module for Turing College Data Science course Module 1 Sprint 1. Performs basic calculations with internal memory.

Project description

Calculator Project

A simple calculator module that provides basic arithmetic operations and memory management.

Structure

.
├── akvile_turing_calculator/
│   ├── __init__.py
│   └── calculator.py
├── tests/
│   ├── __init__.py
│   ├── test_add.py
│   ├── test_divide.py
│   ├── test_multiply.py
│   ├── test_reset.py
│   ├── test_root.py
│   └── test_subtract.py
├── LICENSE
├── README.md
├── requirements.txt
├── pyproject.toml
└── poetry.lock

Features

  • Basic arithmetic operations: addition, subtraction, multiplication, division, and nth root.
  • Memory management: store and use results from previous calculations.
  • Type validation: ensures that the inputs are of appropriate types.

Installation

Poetry

To install with poetry use poetry add akvile-turing-calculator

pip

To install with pip use pip install akvile-turing-calculator

Usage

python

from akvile_turing_calculator.calculator import Calculator

calc = Calculator()
print(calc.add(5))          # Outputs: 5.0
print(calc.subtract(2))     # Outputs: 3.0
print(calc.multiply(4))     # Outputs: 12.0
print(calc.divide(3))       # Outputs: 4.0
print(calc.root(2))         # Outputs: 2.0
calc.reset()                # Resets memory to 0.0

Testing

Tests are located in the tests/ directory and can be run using pytest.

To run all tests use pytest tests/.

Contributing

  1. Fork the repository.
  2. Create a new branch for your features or fixes.
  3. Write tests that cover your changes.
  4. Submit a pull request and provide a detailed description of your changes.

License

This project is licensed under the terms of the LICENSE file.

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

akvile_turing_calculator-0.1.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

akvile_turing_calculator-0.1.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file akvile_turing_calculator-0.1.1.tar.gz.

File metadata

  • Download URL: akvile_turing_calculator-0.1.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.1 Windows/10

File hashes

Hashes for akvile_turing_calculator-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6a51c688f677f6b47b4e12c3bb882791d0f89673a086849bd637aacb6e64f5b9
MD5 6d320a5f6455406cc10d223a41b9caab
BLAKE2b-256 f1c71650b3197d6ef649a77d05dacf98312b62ce48a715999ad91551c1142c16

See more details on using hashes here.

File details

Details for the file akvile_turing_calculator-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for akvile_turing_calculator-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 66cf59932d96564e465e7823fea70af8b43d82259d06e45df4a78965aa6b9928
MD5 aca031b3abcffd7e361820e7cbfac197
BLAKE2b-256 4bc93176381bb48e0b77d3ea9f450f321d617b75fdbd23b5db1cf956a78f86f4

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