Python Package Arithmetic Trainer
This package allows users to test their basic arithmetic and mental math skills.
Documentation
add(a, b)
The add function takes in two numbers (a, b) and returns the sum.
from team1ArithmeticTrainer import functions
functions.add(5, 10)
subtract(a, b)
The subtract function takes in two numbers (a, b) and returns the difference.
from team1ArithmeticTrainer import functions
functions.subtract(10, 5)
multiply(a, b)
The multiply function takes in two numbers (a, b) and returns the product.
from team1ArithmeticTrainer import functions
functions.multiply(10, 5)
divide(a, b)
The divide function takes in two numbers (a, b) and returns the quotient.
from team1ArithmeticTrainer import functions
functions.divide(10, 5)
sqr_root(a)
The sqr_root function takes in one number (a) and returns the square root.
from team1ArithmeticTrainer import functions
functions.sqr_root(16)
cube_root(a)
The cube_root function takes in one number (a) and returns the cube root.
from team1ArithmeticTrainer import functions
functions.cube_root(27)
modulus(a, b)
The modulus function takes in two numbers (a, b) and returns the remainder.
from team1ArithmeticTrainer import functions
functions.modulus(27, 5)
checkPerfectSquare(num)
The checkPerfectSquare function takes in one number (num) and checks if it is a perfect square.
from team1ArithmeticTrainer import functions
functions.checkPerfectSquare(16)
checkPerfectCube(num)
The checkPerfectCube function takes in one number (num) and checks if it is a perfect cube.
from team1ArithmeticTrainer import functions
functions.checkPerfectCube(125)
generate_question()
The generate_question function generates a random arithmetic question choosing either an addition, subtraction, multiplication, division, sqr root, modulus, or cube root problem.
from team1ArithmeticTrainer import functions
functions.generate_question()
print_prompt(question, a, b)
The print_prompt function takes three parameters (question, a, b) and prompts the user to answer an arithmetic problem.
from team1ArithmeticTrainer import functions
functions.print_prompt(add, 5, 10)
Program utilizing all functions (Note some of the above functions are auxiliary functions)
How to install and use this package
Try installing and using your package in a separate Python project:
- Create a
pipenv-managed virtual environment and install the latest version of your package installed:pipenv install -i https://test.pypi.org/simple/ examplepackagefb1258==0.0.7. (Note that if you've previously created apipenvvirtual environment in the same directory, you may have to delete the old one first. Find out where it is located with thepipenv --venvcommand.) - Activate the virtual environment:
pipenv shell. - Create a Python program file that imports your package and uses it, e.g.
from examplepackagefb1258 import wisdomand thenprint(wisdom.get())(replacewisdomandget()with any module name and function that exists in your package) . - Run the program:
python3 my_program_filename.py. - Exit the virtual environment:
exit.
Try running the package directly:
- Create and activate up the
pipenvvirtual environment as before. - Run the package directly from the command line:
python3 -m examplepackagefb1258. This should run the code in the__main__.pyfile. - Exit the virtual environment.
How to run unit tests
Simple example unit tests are included within the tests directory. To run these tests...
- Install pytest in a virtual environment.
- Run the tests from the main project directory:
python3 -m pytest. - Tests should never fail. Any failed tests indicate that the production code is behaving differently from the behavior the tests expect.
Pro tip
While working on the package code, and verifying it behaves as expected, it can be helpful to install the package in "editable" mode so that changes to the package are immediately updated in the virtual environment.
- To do this, run
pipenv install -e .from the main project directory.
Team Members
Link to Package on PyPi
Metadata
Release files for arithmeticTrainer 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| arithmeticTrainer-0.0.1.tar.gz | 42.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| arithmeticTrainer-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 71.6 kB
Release files / arithmeticTrainer-0.0.1.tar.gz
| Download URL | arithmeticTrainer-0.0.1.tar.gz |
|---|---|
| Size | 42.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fe3ff115a60e7b88e84e8cfb56a47d41d98458fab684aa3060cc3c6adf97c459
|
|
BLAKE2b-256 checksum How to use checksums |
67da1eb7e88370341524d6619e70365513aa117919bc6a4b5b3096260a7c9a1e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.1
|
Release files / arithmeticTrainer-0.0.1-py3-none-any.whl
| Download URL | arithmeticTrainer-0.0.1-py3-none-any.whl |
|---|---|
| Size | 29.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
270c8e78805a86d41215c89e52c631de949eca7740a525fe20d403acb799f1f9
|
|
BLAKE2b-256 checksum How to use checksums |
cd077afd6e7909bfa8ee8b5ab71aadd45a2bf0e48a6e5d4beacbc8fc616dd75e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.1
|
Security for arithmeticTrainer 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.