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.
# Write your code heres=s.split(":")hours=int(s[0])minutes=int(s[1])seconds=int(s[2][:2])am_pm=s[2][2:]ifam_pm=="PM":ifhours>=1:hours=hours+12elifam_pm=="AM":ifhours>=12:hours=hours-12hours="{:02}".format(hours)minutes="{:02}".format(minutes)seconds="{:02}".format(seconds)returnf"{hours}:{minutes}:{seconds}"
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 →