Seconds to Clock
beginnerUp next
Strings and User Input
Slice and transform text, build messages with f-strings, and read values typed by the user.
Next lessonUp next
Slice and transform text, build messages with f-strings, and read values typed by the user.
Next lessonOutput will appear here...
The starter code reads a number of seconds. Convert it into hours, minutes and seconds and print them in the format hours:minutes:seconds, with no zero padding.
For an input of 3725, a correct solution prints 1:2:5, because 3725 seconds is 1 hour, 2 minutes and 5 seconds.
Tip
// gives whole divisions and % gives remainders. Peel off the hours first, then work with what's left.
No comments yet. Start the discussion.