Last active
April 1, 2016 11:40
-
-
Save M-ZubairAhmed/28dbbe95d5974aa2fb62d68735aa7bd7 to your computer and use it in GitHub Desktop.
This program splits the seconds you enter into Days:Hours:Minutes:Seconds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while True: | |
print("This program splits the seconds you enter into Days:Hours:Minutes:Seconds") | |
n = int(input("enter seconds")) | |
days = n // (24*60*60) | |
days_rem = n %(24*60*60) | |
hours = days_rem // (60*60) | |
hours_rem = days_rem % (60*60) | |
minutes = hours_rem//60 | |
seconds = hours_rem%60 | |
print(days, "days", hours, "hours", minutes, "minutes", seconds, "seconds") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment