Skip to main content

No project description provided

Project description

Calculator Project

Calculator module that accepts arithmetic operations as user input and stores resulting value in memory.

Structure

.
├── tests/
│   ├── __init__.py
│   └── test_calculator.py
├── turing_calc/
│   ├── __init__.py
│   ├── calculator.py
│   └── main.py
├── README.md
└── pyproject.toml

Features

  • Basic arithmetic operations: addition, subtraction, multiplication, division, and nth root.
  • Memory management: store and use results from previous calculations and reset to 0.
  • Format validation: ensures that the inputs are properly formatted.

Installation

Poetry

To install with poetry use poetry add turing_calculator

pip

To install with pip use pip install turing_calculator

Usage

python

from calculator import Calculator

calc = Calculator()
print(calc.add(10))         # Outputs: 10.0
print(calc.sub(2))          # Outputs: 8
print(calc.mul(4))          # Outputs: 32.0
print(calc.div(2))          # Outputs: 16.0
print(calc.root(4))         # Outputs: 2.0
calc.clear()                # Resets memory to 0.0
calc.quit()                 # Exits module

Testing

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

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

turing_calc-0.1.3.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.

turing_calc-0.1.3-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file turing_calc-0.1.3.tar.gz.

File metadata

  • Download URL: turing_calc-0.1.3.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Windows/11

File hashes

Hashes for turing_calc-0.1.3.tar.gz
Algorithm Hash digest
SHA256 835ea56b22b9a8d3eef8d734abafae8e0f182e5f13e62fde65dbee7c912ea5ba
MD5 08f74640a7225b0d1235557d880f2979
BLAKE2b-256 3f3f71da46abda830378727a1688c5fb750bb375eeec027a07b066c3cf50477a

See more details on using hashes here.

File details

Details for the file turing_calc-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: turing_calc-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Windows/11

File hashes

Hashes for turing_calc-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b60b7e757be51df86b5b4617eac99ce73a1287bacb8b8d53301f7f86d7baacb7
MD5 0b07bea36036814c6b42cf5074d9d1f5
BLAKE2b-256 fc776e70ea56c455939d67b93ffe1a9956954a3f3a1235c23c9f350bea2083df

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