We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
deftimeConversion(s):# Write your code herehour=s[0:2]remaining=s[2:8]time_format=s[8:10]iftime_format=="PM":ifint(hour)<12:hour=int(hour)+12elifint(hour)>12:hour=int(hour)+1eliftime_format=="AM":
if int(hour) == 12:
hour="00"
return(str(hour)+remaining)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Time Conversion
You are viewing a single comment's thread. Return to all comments →