0

MilitaryTime code[SOLVED]

a=input("") c=a.split() if c[1]=="AM": print(c[0]) elif c[1]=="PM": print(str(int(c[0].split(":")[0])+12)+":"+c[0].split(":")[1]) Why doesnt it work

30th Jul 2020, 8:24 AM
Yahya Bey
Yahya Bey - avatar
3 odpowiedzi
+ 2
when i put in 2:47 AM #the output is 2:47 it should be 02:47 (XX:XX format)
30th Jul 2020, 8:52 AM
Slick
Slick - avatar
+ 1
Thanks guys its done
30th Jul 2020, 11:11 AM
Yahya Bey
Yahya Bey - avatar
0
Hi! You are soon getting there, but you need to add some lines. It is easy to miss, but you have to fix so 12:34 AM => 00:34. Regards /Per B
30th Jul 2020, 10:14 AM
Per Bratthammar
Per Bratthammar - avatar