THE CHALLENGESECONDS — Converting a duration.
Read a whole number of seconds and convert it into hours, minutes and seconds. Print the result in the format H:M:S (no leading zeros).
Input:
3725
Output:
1:2:5
Challenge: zero loops and a single print. Cut the time up with // and % only.
Checks (verified automatically before your code runs):
- At least 2 use of the // operator.
- At least 1 use of the % operator.
- No loops at all: no for, no while, no comprehensions.
- Exactly 1 call to print().
- Print variables, not typed-in values: print(level) is accepted, print(5) is not.
Hint: minutes = (total % 3600) // 60 and seconds = total % 60.