Some Python Scripts and Exercises
Python Exercises from Practice Python
Scripts | Exercises | Tests |
---|---|---|
ex_01.py | 1: Character Input | ✅ |
ex_02.py | 2: Odd Or Even | |
ex_03.py | 3: List Less Than Ten | |
ex_04.py | 4: Divisors | |
ex_05.py | 5: List Overlap | |
ex_06.py | 6: String Lists | |
ex_07.py | 7: List Comprehensions | |
ex_08.py | 8: Rock Paper Scissors | |
ex_09.py | 9: Guessing Game One | |
ex_10.py | 10: List Overlap Comprehensions | |
ex_11.py | 11: Check Primality Functions |
- git clone the project
- cd into the project
cd python-general-scripts-exercises
- Start a venv (virtual environment)
python3.10 -m venv env
- Activate the venv
source env/bin/activate
- Install the requirements
pip3.10 install -r requirements.txt
- Run the tests
clear; PWDEBUG=1 pytest -vx
- If all pass, run the scripts
python3.10 NAME_OF_THE_SCRIPT.py
- To deactivate the venv
deactivate
Run the coverage with pytest and show the missing lines
coverage run -m pytest; coverage report --show-missing