Command Palette

Search for a command to run...

Hectal
Phase 1: Values, Variables and Types
Python · Exercise 3 of 6 PreviousNext
Beginner

Seconds into hours, minutes, seconds

total_seconds is 3725. Fill in the variables hours, minutes and seconds so that they describe the same time (there are 3600 seconds in an hour and 60 in a minute).

The last line prints them as a clock, 1:02:05: minutes and seconds are padded with a zero to two digits. Keep that line as it is, and replace the three 0 values with your calculation.

What Check tests

  1. hours is 1
  2. minutes is 2
  3. seconds is 5
  4. The three parts add back up to total_seconds
  5. The answer is calculated, not typed
  6. The program prints 1:02:05

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

main.py
Sign in to run your code.

Output

Press Run to see what your program prints.