Skip to main content

A simple calculator package

Project description

Calculator Package

This package provides a simple calculator class. The fuctions available in calculator: Addition / Subtraction. Multiplication / Division. Take (n) root of a number.


You can install the package via pip:

pip install calculator-package-foxylex


from calculator.calculator import Calculator

# Create a new calculator instance
calc = Calculator()

# Perform arithmetic operations
print("Addition result:", calc.memory)  # Output: 5

print("Subtraction result:", calc.memory)  # Output: 2

print("Multiplication result:", calc.memory)  # Output: 8

print("Division result:", calc.memory)  # Output: 4.0

print("Square root result:", calc.memory)  # Output: 2.0

# Reset the memory
print("Memory after reset:", calc.memory)  # Output: 0


The Calculator Package supports the following operations:

Addition Subtraction Multiplication Division Taking the nth root

Unit Tests

Unit tests for the Calculator Package are located in the tests/ directory. These tests ensure that each operation functions correctly and that error handling is implemented where necessary. To run the unit tests, use the following command:

python -m unittest tests.test_calculator


This project is licensed under the MIT License. See the LICENSE file for details.

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

calculator-package-foxylex-1.0.0.tar.gz (3.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page