Episode 2 — The Curfew
Programming with Python · Tutorial 02
The city just banned deliveries after 22:00, so your app has to learn to say “sorry, we’re closed” at the right moment. In this notebook you teach it to make decisions with if / elif / else, apply a discount ladder to bigger orders, and loop over the day’s orders to total them up, while fixing Kevin’s off-by-one order counter along the way. It ends in a price war with MunchCorp that only a while loop can win.
Work on the notebook
Open in browser (recommended): runs entirely on your machine, in this tab: no account, no installation, and after it loads no internet is needed.
Your progress lives in this browser tab. If you reload the page (Cmd/Ctrl + R) your work is still there. But if you close the tab and open the link again later, you start from a clean notebook. There is no cross-device sync in the browser, and clearing browser data or private mode also wipes it.
So: download your .py before you leave (menu → Download → Download Python code). That download is the only guaranteed copy. Handing in files works exactly like this in the checkpoints, so you get to practice the motion every week. Note: a downloaded .py is for submission and backup. You can’t upload it back into the browser editor.
Open in molab: marimo’s free cloud (account required). Your copy saves to your account and reopens on any device. Choose this if you know you’ll switch computers or want to be certain nothing is lost. Optional: nothing graded ever requires it.