What is wrong in the following code? It's military time question from code coach. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is wrong in the following code? It's military time question from code coach.

st=input() lenn=len(st) time=st[lenn-2] if time.lower() == "a" and st[0:2]=="12": print("00"+st[2:5]) elif time.lower()== "a" and st[0:2]!="12": print(st[:lenn-2]) elif time.lower()=="p" and st[0:2]=="12": print(st[:lenn - 2]) else: ind= st.index(":") print(str(int(st[0:ind])+12)+":"+ st[ind+1:lenn-2])

10th Sep 2020, 12:10 PM
Prat
Prat - avatar
1 Answer
+ 1
Ohh yeah thanks
10th Sep 2020, 12:22 PM
Prat
Prat - avatar