Script
#!/usr/local/bin/python3.7
seconds = int(input('Please enter the number of seconds: '))
hours = seconds // 3600
seconds = seconds % 3600
minutes = seconds // 60
seconds = seconds % 60
print(hours, "hours,", minutes, "minutes ", seconds, "seconds")
Execution
Please enter the number of seconds: 7437
2 hours, 3 minutes 57 seconds
Please enter the number of seconds: 6323
1 hours, 45 minutes 23 seconds
No comments:
Post a Comment