Space Python Loading Python…

Orbit Clock

Write the codeMedium 3 stages

The space station circles Earth about every 92 minutes. Its mission log stores time in minutes only, so a reading like 1565 means nothing at a glance.

Build the clock the crew has been asking for. You'll need two operators: //, which divides and drops the remainder, and %, which gives just the remainder.

The program reads the mission time in minutes. Print it as full hours and the minutes left over. For 320:

5 h 20 min
Split minutes into hours and minutes

Finish stage 1 to unlock this stage.

One orbit takes 92 minutes. Below the time, print how many full orbits the station has completed, and how many minutes it is into the current one. For 320:

5 h 20 min
Orbits completed: 3
Minutes into this orbit: 44
Count the full orbits
Show the minutes into the current orbit
All three lines, in order

Finish stage 2 to unlock this stage.

Missions last for days, and 26 h 5 min is hard to read too. Add days to the first line: full days first, then the hours and minutes left over. The orbit lines stay as they are. For 1565:

1 d 2 h 5 min
Orbits completed: 17
Minutes into this orbit: 1

Short missions show 0 d: 320 is 0 d 5 h 20 min.

Show days, hours and minutes
The orbit lines still work
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

Floor Division and Modulo

floor-division-modulo.py
# Floor division (//) and modulo (%)

# ISS completes one orbit every 92 minutes
# How many full orbits in 24 hours?
minutes_in_day = 24 * 60
orbit_period = 92

full_orbits = minutes_in_day // orbit_period
remaining = minutes_in_day % orbit_period

print("Full ISS orbits per day:", full_orbits)
print("Minutes into next orbit:", remaining)

# Mars signal delay: 1,124 seconds
# Break into minutes and seconds
signal_delay = 1124
minutes = signal_delay // 60
seconds = signal_delay % 60
print(f"\nMars signal delay: {minutes} min {seconds} sec")

# Distribute 50 rations among 6 crew members
rations = 50
crew = 6
per_person = rations // crew
extras = rations % crew
print(f"\nRations per astronaut: {per_person}")
print(f"Extra rations: {extras}")

# Check if a mission number is even or odd
mission = 42
if mission % 2 == 0:
    print(f"\nMission {mission} is even")
else:
    print(f"\nMission {mission} is odd")
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:].