Objective
A function can return several values at once: it actually returns a tuple, which can be unpacked into several variables when calling it.
Instructions
- Define
split_time(seconds)that receives a number of seconds and returns the three values(hours, minutes, seconds)(you can usedivmod). - Read
nand thennnumbers of seconds, one per line. - For each one, receive the three values by unpacking them and show
HH:MM:SSwith two digits in each part (for example01:01:01).
3
3661
59
86399
01:01:01
00:00:59
23:59:59
Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.
Start exercise