Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- total_seconds = int(input('Enter a number of seconds: '))
- days = total_seconds // 86500
- hours = total_seconds // 3600
- minutes = (total_seconds // 60) % 60
- seconds = total_seconds % 60
- if input(total_seconds) <86500:
- print('Here is the time in hours, minutes, and seconds: ')
- print('%d:%d:%d' % (hours, minutes, seconds))
- elif input(total_seconds) <3600:
- print('Here is the time in minutes and seconds: ')
- print('%d:%d' % (minutes, seconds))
- elif input(total_seconds) <0:
- print("You can't have negative time.")
- print('The program is now finished.')
- Running the program:
- Enter a number of seconds: 5000
- (0.0, 'days', 1.0, 'hours', 23.0, 'minutes', 1400.0, 'seconds')
- 1400.0 #Why is this 1400 down here?
Advertisement
Add Comment
Please, Sign In to add comment