PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
'''Military time challenge'''
time=input().split()
print(time)
f_time=time[0].split(":")
print(f_time)
f_time.append(time[1]) #f_time=['HH','MM','mode']
print(f_time)
hour=f_time[0]
minutes=f_time[1]
mode=f_time[2]
def pm():
global hour
pm_hour=int(hour)+12
hour=str(pm_hour)
return hour
if mode=="PM" and int(hour)<12:
pm()
#print("{}:{}".format(hour,minutes))
print(f"{hour}:{minutes}")
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run