Hi All -
My code is here.
All tests pass but i expect the code is a bit clunky. Is there a better way to handle the 12 O’Clock case?
new_hour = new_hour%24
if (new_hour >= 12):
new_hour -= 12
period = "PM"
else:
period = "AM"
if (new_hour == 0):
new_hour = 12
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15
.
Challenge: Time Calculator
Link to the challenge: