Date format 2
Input
200
Output
3 minutes 20 seconds
t = int(input())
hr = t // 3600
t = t % 3600
min = t // 60
sec = t % 60
if hr > 1:
print(hr, 'hours', end=' ')
if hr == 1:
print('1 hour', end=' ')
if min > 1:
print(min, 'minutes', end=' ')
if min == 1:
print('1 minute', end=' ')
if sec > 1:
print(sec, 'seconds', end='')
if sec == 1:
print('1 seconde', end='')
print()
Comments
Leave a comment