The crew has a new home: Beacon Station, high above the clouds. Rocket taps the big screen in the control room. "Let's make it say hello to everyone!" he says.
He types a line of real Python, but the screen shows an error. Raven leans in. "What do you notice about the words?" she asks. Rocket looks closer. Some words have quote marks, and some do not.
Nova hovers beside them, her cyan lights glowing. "Would you like a hint? Python needs to know where a message starts and where it stops."
Last year you wrote pseudocode. This year you will read and write real Python.
Python runs a program one line at a time, from the top to the bottom.
The print command shows something on the screen. Here is a program with two lines.
print("Hello, crew!")
print("Welcome to Beacon Station") | The screen shows |
|---|
| Hello, crew! |
| Welcome to Beacon Station |
| Line of Python | Does the string have a quote mark at both ends? |
|---|---|
| print("Ready") | ? |
| print("Dock 3) | ? |
| print("All clear") | ? |
| print(Hatch open") | ? |
print("Dock 4 is open")
print("Crew of 3")
print("Bye for now") | Statement | True or false? |
|---|---|
| Python runs the bottom line first. | ? |
| The quote marks show on the screen. | ? |
| Each print starts a new line. | ? |
| print("7") shows 7 on the screen. | ? |
Great start, Crew Engineer! You read your first real Python today. Tomorrow you will give a value a name, so you can use it again and again.