PY
py
1
2
3
4
5
6
7
8
t = input().split()
hm = t[0].split(":")
h = int(hm[0])
if t[1] == "PM":
h = 12 if h == 12 else h + 12
else:
h = 0 if h == 12 else h
print(f"{h:0>2}:{hm[1]}") # 0>2 pads to 2 digits with zeros
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run