python · level 1 · unit 1 · lesson 3
- meet it
- guess first
- your turn
- fix it
- nailed it
Tap a green word if you get lost.
meet it
Lines run in order, one after another.
A program can have lots of lines. Python runs them in order, top to bottom, like ticking off a shopping list. Everything your program shows on the screen is called its .
An empty print() has nothing to show, so you get a blank line. It is handy for spacing things out.
You can also give one print several strings. Put a comma between them and Python shows them on one line, with a space between each.
print("Ready")
print("Steady")
print()
print("Go!") The commas go between the strings, outside the quote marks.
guess first
How will this look on the screen?
Guess before you run it. Wrong guesses are how you learn, and nothing is marked.
print("Fish", "and", "chips")
your turn
Your turn. Write a knock knock joke.
Type who is at the door on lines 3 and 4, the same both times. Put your punchline on line 5, then press run and enjoy your output.
fix it
The cheer is all squashed. Can you fix it?
- Run it and look at the output. Where have the spaces gone?
- There should be a comma between each string inside the brackets.
- Add a comma after "Hip" and after "hip", then press run.
nailed it
you made the computer tell a joke. :D
- Lines run in order, from top to bottom.
- An empty
print()makes a blank line. - Commas let one
printshow several strings, with spaces between.
new words in your collection
- output
This lesson isn’t saved. A free account remembers every lesson you finish.