Lab: Clean Tom's notebook and print a slip
Module 3 · Lab · About 45 minutes · Needs: lessons 1 to 3 of this module, and Module 2 (comparisons,int(),
What you are building
Amira's question for this module is "Can you read Tom's notebook?" The three lessons each cleaned one or two lines. This lab cleans the whole notebook in one notebook session, using only what you have learnt: slices, string methods and f-strings. There are no loops yet (Module 4) and no files yet (Module 8), so every step works on the notebook as one long string.
Of the twelve lines, three have faults that text tools can fix: the short date on line 4, Frankenstien on line 5 and lena on line 6. Two cannot be fixed by text alone. Line 8 says Kidnapped came back before it went out, which only Amira can settle, so you set it aside. Line 11 is a copy of line 7, so you drop it. That leaves ten clean lines, a lined-up cleaning report and a loan slip for Ben's Frankenstein.
Open a new Colab notebook, call it module-03-lab.ipynb, and run each cell in order.