Skip to main content

Hello!

For the Module 1 Sprint 1 project I was supposed to create a Python package that is capable of conducting basic calculator-like functions, including:
  • Addition/ Subtraction;
  • Multiplication/ Division;
  • Taking (n) root of a number;
  • Resetting memory.

    IMPORTANT note! Calculator is capable of accepting both integers and float numbers.

    How to use it?

    1. First of all, let's install the package. It can be accessed both - in your local machine and remote (like Google Colab)

    pip install TACalculator-v3
    

    2. Import module "Calculator" from a package

    from file.calculator import Calculator
    

    3. Create an instance of the Calculator class:

    calculator = Calculator()
    

    *IMPORTANT note: By default calculator's memory is set to 0.0

    Known biases, possible areas for improvement:

    1. Error handling and input validation. It is expected that user will by himself handle possible Errors i. e. (division by Zero, math with string values, etc.)
    2. Additional functionality. Calculator can easily have more algebra functions.

    Main functions

    Addition

    To add a value to the memory value, use the add(value) method. This will add 12.0 to the memory value and will return the new value.

    calculator.add(12.0)
    

    Substraction

    To subtract a value from the memory value, use the subtract(value) method. This will subtract 5.0 from the memory value and will return the new value.

    calculator.subtract(5.0)
    

    Multiplication

    To multiply the memory value by a value, use the multiply(value) method. This will multiply the memory value by 6.0 and will return the new value.

    calculator.multiply(6.0)
    

    Division

    To divide the memory value by a value, use the divide(value) method. This will divide the memory value by 2.0 and will return the new value.

    calculator.divide(2.0)
    

    Root

    To take the 1/nth root of the memory value, use the root(value) method. This will take the third level root of the memory value and will return the new value.

    calculator.root(3)
    

    Reset

    To reset the memory value to 0.0, use the reset() method. This will reset the memory value to 0.0 and will return the 0.0 value.

    calculator.reset()
    

    Thank you for you attention!

    I am open for a feedback!

  • Release files for TACalculator-v3 0.4

    For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

    Source distribution (sdist)

    Source distribution for TACalculator-v3 0.4
    File Size Uploaded
    TACalculator-v3-0.4.tar.gz 7.0 kB Details

    Built distribution (wheel)

    Table of built distributions (wheels) for TACalculator-v3 0.4
    File Interpreter ABI Platform
    TACalculator_v3-0.4-py3-none-any.whl Python 3 none any Details

    Total release size: 14.8 kB

    Release files / TACalculator-v3-0.4.tar.gz

    Download URL TACalculator-v3-0.4.tar.gz
    Size 7.0 kB
    Tags Source
    SHA-256 checksum
    How to use checksums
    102d5234a4e7e1dabad3f7d2457255bb8d4ecbd67e7edd03f3c12778bc3d0bc8
    BLAKE2b-256 checksum
    How to use checksums
    fcc0fa8c897958146f2bbaf3e88173285a89384c5b3d89894fce835376d13441
    Upload date
    Uploaded using Trusted Publishing?
    What is trusted publishing?
    No
    Uploaded via twine/4.0.2 CPython/3.9.12

    Release files / TACalculator_v3-0.4-py3-none-any.whl

    Download URL TACalculator_v3-0.4-py3-none-any.whl
    Size 7.8 kB
    Tags Python 3
    SHA-256 checksum
    How to use checksums
    71efb7a50a948a01a6dfd39611696ff99ff9f0ca4750151838173d6728defbbb
    BLAKE2b-256 checksum
    How to use checksums
    7bfb1c07c2386fdb071e137ab677b250087db1d407ab67e4f7bfb049d671d249
    Upload date
    Uploaded using Trusted Publishing?
    What is trusted publishing?
    No
    Uploaded via twine/4.0.2 CPython/3.9.12

    Release history Release notifications | RSS feed

    This release

    0.4 This release

    2 release files

    0.3

    2 release files

    0.2

    2 release files

    0.1

    2 release files

    Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page