Skip to content

Instantly share code, notes, and snippets.

@lacytimlick
Created January 12, 2020 19:33
Show Gist options
  • Save lacytimlick/f7c182b1b0d67192bde402afb85c68a4 to your computer and use it in GitHub Desktop.
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.
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=(":"))
@tanujgandhi89
Copy link

at what level should this be taught

@tanujgandhi89
Copy link

can some please explain in detail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment