← Back to course
Code Crew G6+ / Week 01 / Crew Quest
6/6
Week 01 Β· Hello, Mission Control

Crew Quest

Crew Quest: Launch banner
// Your first real Python programs
⏱ about 30 min

Saturday: Crew Quest: Launch banner

Saturday morning, Mission Control is calm and sunny. Rocket has printed his launch banner program on paper and taped it to the wall beside the big screen.

"Every crew member should have a banner," he says. "But first I want to explain how it works to someone who has never seen Python."

Raven nods and pulls up two chairs. "What do you notice when you explain something out loud?" she asks. "You find the parts you only half understand."

Nova dims her lights and settles on the desk like an audience of one. "I am ready to listen," she says. "Start from the top line and go slowly."

Rocket clears his throat, points to the first line, and begins.

  1. The shell runs one line when you press Enter. The >>> prompt means Python is ready.
  2. Text inside quote marks is a string. print shows it exactly.
  3. Programs live in files that end in .py. Run Module (F5) runs the whole file from top to bottom.
  4. A # starts a comment. Python skips it, and people read it.
  5. Read an error from the bottom: the error name, then the line number.
β—‡ EXPLAIN YOUR BANNER
Show a grown-up your launch_banner.py program, or write it out on paper.
Read each line aloud and say what it does. Point out the comments and explain who they are for.
Ask your grown-up to predict the output before you run it. Then run it and compare.
Together, add one more print line and one comment. Save it and run it again.
WEEK 1 CHECK
  • Read the question.
  • Tap your answer.
You run a file and the shell shows NameError on the last line. Where do you look next?
What does print("Go " * 2) show?
This line has a bug: print("Banner ready). What is missing? (one word)
WHY THIS EXERCISEA string needs a quote mark at both ends. Without the closing one, Python gives a SyntaxError.
MORE REVIEW: WEEK 1
  • Read the question.
  • Tap your answer.
Which window keeps your program after you close IDLE?
What does print("5 + 5") show?
Python stops with a runtime error on line 4. Did lines 1 to 3 run?

Great work this week. Next week your programs start remembering values and asking questions.

← Friday