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 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.2.tar.gz (3.1 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.2-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: akvile_turing_calculator-0.1.2.tar.gz
  • Upload date:
  • Size: 3.1 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.2.tar.gz
Algorithm Hash digest
SHA256 2f3107636b64bb48adaad9804be5dfa042c5e181267c6b9bd6322f2d68196ba0
MD5 1d070c1c3da1697fb5ca79885d69308a
BLAKE2b-256 9328ebef6b6b203bfc69e80d9043aa3abde40e1311741338d05d3695b70ca001

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for akvile_turing_calculator-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 48607baea5f5b47aebdb54d2743a8e14331335a7f1997c6d8fd8f40b3d819cbe
MD5 4b88467852d71fcbf3a7a247de2e10a8
BLAKE2b-256 5512d5a0633994c9c9452a7a7e1f83021055dfd5e7cae471f8b1a38f00926a42

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