You are viewing a single comment's thread. Return to all comments →
def timeConversion(s): if s[8:] == 'AM': time = s.replace('AM','') a = time.split(':') if a[0] == '12': a[0] = '00' else: pass print(':'.join(a)) elif s[8:] == 'PM': time2 = s.replace('PM','') b = time2.split(":") if b[0] != '12': b[0] = int(b[0]) b[0] += 12 b[0] = str(b[0]) print(':'.join(b)) if b[0] == '12': print(':'.join(b)) s = input() timeConversion(s)
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 →