
Code
Line After Line
A program can have many lines. Python runs them one at a time, from top to bottom, like reading a recipe.
Each print shows its message on a new line:
print("Step 1: find the lantern")
print("Step 2: add oil")
print("Step 3: light it!")
Output:
Step 1: find the lantern
Step 2: add oil
Step 3: light it!
An empty print() prints a blank line, handy for spacing things out.
Start every line at the very left edge. Extra spaces at the start of a line confuse Python. (They mean something special that you'll learn later.)
Assignment
The Guild wants a lantern poem. Print these three lines,
exactly as shown, using three print lines:
Little lantern, shining bright,
guide the ships across the night.
Pythonia glows with your light!The Guild wants a lantern poem. Print these three lines,
exactly as shown, using three print lines:
Little lantern, shining bright,
guide the ships across the night.
Pythonia glows with your light!main.py Python sleeping
Press Run to try your code, then Check to test it.