
Checkpoint
Checkpoint: Harbour Notice
The harbour master wrote a notice for tonight's lantern crew. Sadly, the program has three problems. Fix them all and the notice will shine across the harbour!
This checkpoint uses everything from this chapter: print
lines, comments, fixing a SyntaxError, and letting Python do
the math.
Here is a reminder of how math works inside print:
print("2 + 3") # 2 + 3 (quotes: just text)
print(2 + 3) # 5 (no quotes: Python calculates)
Assignment
- Line 3 is missing a quote. Fix it.
- Replace
___on line 5 with14 + 10, so Python works out the number. Use no quotes! - Line 6 is a plain-English note. Turn it into a comment
with
#, but keep its words.
The output should be:
=== Harbour Notice ===
Lanterns to light tonight:
24
Signed, Pip- Line 3 is missing a quote. Fix it.
- Replace
___on line 5 with14 + 10, so Python works out the number. Use no quotes! - Line 6 is a plain-English note. Turn it into a comment
with
#, but keep its words.
The output should be:
=== Harbour Notice ===
Lanterns to light tonight:
24
Signed, Pipmain.py Python sleeping
Press Run to try your code, then Check to test it.