Space Python Loading Python…

Swapped arguments

Fix the codeEasy 3 stages

The launch board says that Lumen-3 will fly on the Tanegashima launch pad, from a pad called H3. Every value on the line is correct; they are just in the wrong places.

Predict the line, find out where each value went, then fix the call so it can't happen again.

Don't run the code yet. Read it and decide what it will print. Write your guess in prediction, at the top, between the quotes. Then run it and compare.

Any guess passes this stage: the point is to think before you run. After you check, you'll see your prediction next to what Python printed.

Match each value in the call to a parameter, in order.

Predict, then run
Leave the program as it is

Finish stage 1 to unlock this stage.

Investigate. Store the value the parameter rocket receives in rocket_got, and the position of the pad in the call, counting from 1, in pad_position.

Modify. Pass every argument by name, keeping the pad before the rocket in the call, so you can see the order no longer matters. It must print:

2026-11-05: Lumen-3 on H3 from Tanegashima LA-Y2
Find where the values went
Pass by name

Finish stage 2 to unlock this stage.

Call transfer_cargo() twice, with keyword arguments only, in any order you like, and print:

CG-0042: Node 2 -> Lab, 18.5 kg
CG-0043: Airlock -> Node 2, 2.36 kg

from_module and to_module are both module names: exactly the pair that is easy to swap.

Two transfers
Keywords for the modules
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

Positional and Keyword Arguments

positional-keyword-arguments.py
# Four parameters, and the last two carry defaults
def descent_burn(lander, seconds, throttle=100, retrograde=True):
    print(f"{lander}: {seconds} second burn at {throttle} percent")
    print("Retrograde:", retrograde)
    print()

# Positional: Python matches the values by position, left to right
descent_burn("Odysseus", 11)

# Keyword: you name each one, so the order stops mattering
descent_burn(seconds=11, lander="Odysseus")

# These two calls do exactly the same thing
descent_burn("Blue Ghost", 19, 60, False)
descent_burn("Blue Ghost", 19, throttle=60, retrograde=False)

# Keywords let you skip over a default sitting in the middle
descent_burn("Peregrine", 8, retrograde=False)

# Positional arguments must come first. This one is a syntax error:
# descent_burn(lander="Odysseus", 11)
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:].