You are viewing a single comment's thread. Return to all comments →
python3 solution using modulo:
def timeConversion(s): if s[-2:] == 'AM': h = int(s[0:2]) % 12 else: h = int(s[0:2]) % 12 + 12 h = '0' + str(h) if h < 12 else str(h) return h + s[2:6] + s[6: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 →
python3 solution using modulo: