One orbit short
The test flight is ten orbits long, and the flight log should have a line for each one. The log always ends one orbit early, and the last orbit, the one that matters for the landing, is never in it.
Predict the last line, find out where range() stops, fix the loop, then build a schedule of ground station passes.
Finish stage 1 to unlock this stage.
Don't run the code yet. Read it and decide what it will print on its last line. 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.
Which number will orbit have the last time round?
Finish stage 1 to unlock this stage.
Investigate. Store how many orbits the program logs in orbits_logged. Then print list(range(1, 10)) to see every number the range gives, and store the last one in last_in_range. Remove any lines you added before you check.
Modify. Log all ten orbits, and use ORBITS rather than a number, so a longer flight is logged in full too. The last line must be:
Orbit 10: T+920 min
Finish stage 2 to unlock this stage.
The ground station sees the ship on every third orbit: 3, 6, 9 and so on. Print a line for each of those orbits, up to and including the last orbit of the flight:
Ground station pass: orbit 3, T+276 min Ground station pass: orbit 6, T+552 min Ground station pass: orbit 9, T+828 min
range(start, stop, step) takes a third number, the step: range(3, 10, 3) gives 3, 6, 9. Use ORBITS for the stop, so a twelve-orbit flight includes orbit 12.
Hints
For Loop with enumerate and range
# range() produces a run of numbers so you do not have to type them out
print(list(range(5)))
# One argument: starts at zero, stops before the number you gave
for orbit in range(3):
print("Orbit", orbit, "complete")
# Two arguments: a start and a stop. The stop is never included
for day in range(1, 6):
print("Flight day", day)
# Three arguments: the last one is the step, and it can go backwards
for altitude in range(100, 0, -25):
print(altitude, "km above the surface")
# enumerate() hands you the position and the item at the same time
checklist = ["hatch sealed", "fuel loaded", "guidance online", "range clear"]
for position, task in enumerate(checklist):
print(position, task)
# start=1 numbers things the way a human would
for position, task in enumerate(checklist, start=1):
print(f"Step {position}: {task}")
# Without enumerate you would be counting by hand
count = 0
for task in checklist:
count = count + 1
print("Items checked:", count)
Separate arguments with commas. They're passed on every Run as sys.argv[1:].