No project description provided
Reason this release was yanked:
Para que solo haya una
Project description
Module 1: Data Wrangling with Python
Sprint 1: Python Mastery
Part 5: Calculator
The following project consists of a calculator written with Python. It contains a Calculator class. This class has an internal memory, whose initial value is 0, and can perform a number of operations, which will modify the value in memory:
-Add a value to the value stored in memory -Subtract a value to the value stored in memory -Multiply a value by the value stored in memory -Divide the value stored in memory by another value -Calculate the nth root of the value stored in memory -Reset the value stored in memory to 0
Since all operations (except resetting the value in memory) require an argument, two assertions have been included in order to make sure a valid argument is passed: -For all operations, the argument passed must be a number (either an int or a float). Otherwise, an AssertionError will be raised -Furthermore, to calculate the nth root of the value in memory, the argument passed cannot be 0. This is to prevent division by 0 (since the nth root of a number is equal to said number to the 1/nth power)
Here is a practical example of how the application works
calculator = Calculator()
calculator.add(10)
calculator.subtract(5)
calculator.multiply(4)
calculator.divide(5)
calculator.calculate_nth_root(2)
calculator.reset_memory()
In order to make sure the application works properly, unit tests have been written for all operations and assertions. unittest has been imported for this purpose.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for calculator_package_gusaezg-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7e43a64619769ad7852eddefeb628fde5fb1a01c4529961c4fee64f2e70be6d |
|
MD5 | 2e45608dfba3697d5e597c3e92397add |
|
BLAKE2b-256 | 4b8b821fe92a87f827eddada4447b1a1076d6edbaffb462627cd78492e8f6ba4 |
Hashes for calculator_package_gusaezg-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d229083e460bc828a66a52bb720025d4a67dc99fd720cd0ff2a561b5bca340e2 |
|
MD5 | 2115c69a10694e7d7f8f16c0106a31ce |
|
BLAKE2b-256 | 8f636312442a9785e7aa2d54f502f3042f2e06378749dd773097e669ed9d19bb |