Skip to content

GabriOliv/python-general-scripts-exercises

Repository files navigation

Some Python Scripts and Exercises

Python Version


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

How install and run the scripts

  1. git clone the project
  2. cd into the project
    cd python-general-scripts-exercises
  3. Start a venv (virtual environment)
    python3.10 -m venv env
  4. Activate the venv
    source env/bin/activate
  5. Install the requirements
    pip3.10 install -r requirements.txt
  6. Run the tests
    clear; PWDEBUG=1 pytest -vx
  7. If all pass, run the scripts
    python3.10 NAME_OF_THE_SCRIPT.py
  8. To deactivate the venv
    deactivate

Run Coverage

Run the coverage with pytest and show the missing lines

coverage run -m pytest; coverage report --show-missing