Skip to main content

This module contains a Calculator

Project description

Calculator_gskv_m1_s1

Calculator_gskv_m1_s1 is a Python module for performing simple mathematical operations.

Installation

Use the package manager pip to install calculator_gskv_m1_s1.

pip install calculator_gskv_m1_s1

Usage

import calculator_gskv_m1_s1 as calc

# Initiates a calculator object with a default value of 0
calculator=calc.Calculator()

# Returns the current value of the calculator object
calculator.current_value

# Adds float or int argument to the current value and returns the result
calculator.add(float)

# Subtracts float or int argument from the current value and returns the result
calculator.subtract(float)

# Multiplies the current value by float or int argument and returns the result
calculator.multiply(float)

# Divides the current value by float or int argument and returns the result
calculator.divide(float)

# Raises the current value to the power of float or int argument and returns the result
calculator.exponentiate(float)

# Takes the root of the current value taking the float or int argument as root index
calculator.root(float)

# Resets the current value to zero returns current value
calculator.reset()

Testing

After making changes to the module tests should be run. Testing the package that is installed can be done by running pytest

pytest

Testing the package that is not installed can be done by invoking pytest trough the python interpreter

python -m pytest

Contributors

Gediminas Skvarnavičius

With the help of Turing College

License

MIT

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_gskv_m1_s1-0.1.4.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

calculator_gskv_m1_s1-0.1.4-py2.py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 2 Python 3

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