+ 3
I can't solve Military Time...
So I think my solution should work, but it fails two cases... Please help... time = input() if time.endswith(" AM"): print(time.replace(" AM", "")) elif time.endswith(" PM"): time = time.replace(" PM", "") time = time.split(":") time = list(map(int, time)) time[0] = time[0] + 12 if time[1] == 0: time[1] = "00" time = list(map(str, time)) time = ":".join(time) print(time) else: time = list(map(str, time)) time = ":".join(time) print(time)
1 Answer
+ 1
Ooooohh, thanks man