Space Python Loading Python…

Broken boot script

Fix the codeEasy 3 stages

The flight computer on Python One runs a short boot script every time it powers on. Last night someone edited the script in a hurry, and now the computer won't start: Python refuses to run the file at all.

When a single quote or bracket is missing, Python can't make sense of the file, so not even the first line runs. That's a SyntaxError. Find what's missing and get the boot script running again.

Run the boot script. Instead of booting, it stops with an error: one line is missing its closing quote. Fix it so the script prints:

Booting flight computer...
Loading navigation data...
Boot complete
Get the script running
Print every boot message

Finish stage 1 to unlock this stage.

The next part of the boot script checks the sensors, and it was edited in the same hurry: a closing bracket is missing. Run it, read the error and fix the line it names. The output must be:

Booting flight computer...
Checking fuel sensors... OK
Checking star tracker... OK
Boot complete
Get the script running
Print every boot message

Finish stage 2 to unlock this stage.

The last part arms the engines. This time two lines are broken: one has quotes that don't match, and another is missing a bracket. Python only reports the first problem it finds. Fix it, run again, and the next error shows up. Keep going until the script prints:

Booting flight computer...
Arming engines...
Engines armed
Boot complete
Get the script running
Print every boot message
You're not logged in, so your progress is kept in this browser only. Log in to save it, and to use hints and solutions.

Hints

First Program - Hello Space

first-program-hello-space.py
# Your first Python program
print("Hello, Space!")

# Python reads your code from top to bottom
# Each print() displays one line of text
print("Mission Control online.")
print("All systems ready.")

# You can print numbers the same way
print(2077)

# Try changing the text inside the quotes
print("3... 2... 1...")
print("Liftoff!")
Open the full example
script.py
PythonLn 1, Col 1Spaces: 4
Loading the Python environment…

Separate arguments with commas. They're passed on every Run as sys.argv[1:].