Ground station pick
ESA talks to its deep-space missions through three big antennas spread around the world: New Norcia in Australia, Cebreros in Spain and Malargüe in Argentina. As the Earth turns, the spacecraft rises over one and sets behind another, so the scheduler picks the station by the longitude on Earth right under the spacecraft.
Pick the station from the longitude, then make the scheduler cope with longitudes written the other common way.
Finish stage 1 to unlock this stage.
Each station covers a band of longitudes. Pick the one the spacecraft is over and print it:
from 60 to 180 New Norcia from -60, below 60 Cebreros below -60 Malargüe
For 100.0 it's Ground station: New Norcia. Go through the bands from east to west, so each elif only needs its lower limit, and store the name in station before printing it.
Finish stage 1 to unlock this stage.
Some tools write longitudes from 0 to 360 instead of from -180 to 180: 296 means 64 degrees west. The starter code picks New Norcia for 296, which is wrong. Before choosing, turn anything over 180 into the usual form by subtracting 360, and reject values that can't be longitudes at all, outside -180 to 360:
Ground station: Malargüe Invalid longitude: 400.0
For 296.0 it prints the first line. Check for impossible values first; only a valid longitude gets converted and gets a station.
Hints
If-elif-else Statement
# Oxygen level on a space station
oxygen = 19.5
if oxygen >= 23:
status = "Warning: fire risk"
elif oxygen >= 19.5:
status = "Normal"
elif oxygen >= 16:
status = "Low"
else:
status = "Critical"
print(status)
# Signal delay from a deep space probe
delay = 14.0 # minutes
if delay < 1.3:
location = "Near the Moon"
elif delay < 5:
location = "Inner solar system"
elif delay < 25:
location = "Outer planets region"
else:
location = "Deep space"
print(f"Delay: {delay} min - {location}")
Separate arguments with commas. They're passed on every Run as sys.argv[1:].