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])
1 Antwort
+ 1
Ohh yeah thanks