Military Time Challenge #test_case_4
I tried hard.. But cant meet the test_case_4 ... Worst of all i dont know what the case is... Heres my code x = {'1':'13', '2':'14', '3':'15', '4':'16', '5':'17', '6':'18', '7':'19', '8':'20', '9':'21', '10':'22', '11':'23', '12':'00'} m = input() c = m.split() k = list(str(c[0])) p = k.index(":") h ="" w ="" n ="" q ="" u ="" if "PM" in c: if p == 2: for t in k[:p]: h +=""+t del k[:2] if h in x: v = x.get(h) w +=""+v for t in k: w +=""+t print(w) elif p == 1: for t in k[:1]: h +=""+t del k[:1] if h in x: v = x.get(h) w +=""+v for t in k: w +=""+t print(w) elif "AM" in c: if p == 2: for t in k[:2]: q +=""+t del k[:2] if q == '12': f = x.get(q) u +=""+f for s in k: u +=""+s print(u) else: g = c.index("AM") del c[g] for s in c: n +=""+s print(n) if p == 1: g = c.index("AM") del c[g] for s in c: n +="0"+s print(n) Hope you can help!!