basic-programming-learning-phase-1

Module 05 — Files and errors

Concepts

Practice prompts

  1. Write 3 lines to output.txt, then read and print them.
  2. Append a 4th line to the same file.
  3. Wrap a division in try/except that handles ZeroDivisionError.
  4. Write parse_int(s) that raises ValueError if s isn’t an integer; handle it in a caller.
  5. Use finally to print "done" regardless of outcome.

Complete the TODOs in starters.py.