Guest User

Untitled

a guest
Oct 2nd, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. total_seconds = int(input('Enter a number of seconds: '))
  2.  
  3. days = total_seconds // 86500
  4. hours = total_seconds // 3600
  5. minutes = (total_seconds // 60) % 60
  6. seconds = total_seconds % 60
  7.  
  8. if input(total_seconds) <86500:
  9. print('Here is the time in hours, minutes, and seconds: ')
  10. print('%d:%d:%d' % (hours, minutes, seconds))
  11. elif input(total_seconds) <3600:
  12. print('Here is the time in minutes and seconds: ')
  13. print('%d:%d' % (minutes, seconds))
  14. elif input(total_seconds) <0:
  15. print("You can't have negative time.")
  16.  
  17. print('The program is now finished.')
  18.  
  19.  
  20. Running the program:
  21. Enter a number of seconds: 5000
  22. (0.0, 'days', 1.0, 'hours', 23.0, 'minutes', 1400.0, 'seconds')
  23. 1400.0 #Why is this 1400 down here?
Advertisement
Add Comment
Please, Sign In to add comment