Skip to content

Fill-In Challenges

Exercises where function stubs are provided — you write the implementation.

How It Works

  1. Open the exercise file. You will see functions with docstrings and # YOUR CODE HERE markers.
  2. Read the docstring carefully — it tells you exactly what the function should do, what arguments it takes, and what it returns.
  3. Replace # YOUR CODE HERE with your implementation.
  4. Run the tests to check your work:
pytest tests/test_01.py -v
  1. If stuck, check solutions/ for the completed code with explanations.

Exercise List

File Topic Difficulty
01_list_filter.py Filtering lists by criteria Beginner
02_dict_builder.py Building dicts from parallel lists Beginner
03_file_reader.py Parsing structured text files Intermediate
04_string_formatter.py String formatting and alignment Intermediate
05_basic_class.py Classes, __init__, __str__, methods Intermediate
06_error_handler.py Try/except, multiple error types Intermediate

Tips

  • Read the docstring before writing any code.
  • Run the tests frequently — they tell you exactly what is expected.
  • Start with the simplest function in each file and work your way up.
  • The tests are not trick questions — if your logic is sound, they will pass.