Created
January 12, 2020 19:33
-
-
Save lacytimlick/f7c182b1b0d67192bde402afb85c68a4 to your computer and use it in GitHub Desktop.
This program asks the user for Hour, Min, Duration. Calculates Time and duration to return end time.
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
hour = int(input("Starting time (hours): ")) | |
mins = int(input("Starting time (minutes): ")) | |
dura = int(input("Event duration (minutes): ")) | |
# put your code here | |
MD = mins+dura | |
#used to brake decimal away and return only whole # | |
TT = MD%60 | |
# md / 60 to get the whole # | |
MDT = int(MD/60) | |
Total = hour+MDT | |
# when it goes past 2400 roll back to 0000 and on | |
FinT = Total%24 | |
print ("End Time", FinT,TT, sep=(":")) |
can some please explain in detail
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
at what level should this be taught