You are viewing a single comment's thread. Return to all comments →
Python Soln def timeConversion(s): if s[8:] == "AM": if s[0:2] == "12": return "00" + s[2:8] else: return s[:8] if s[8:] == "PM": if s[0:2] == "12": return s[:8] else: return str(int(s[0:2]) + 12) + s[2:8]
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 →
Python Soln def timeConversion(s): if s[8:] == "AM": if s[0:2] == "12": return "00" + s[2:8] else: return s[:8] if s[8:] == "PM": if s[0:2] == "12": return s[:8] else: return str(int(s[0:2]) + 12) + s[2:8]