Military time code coach challenge
I have finally solved this challenge and it took me an hour. https://www.sololearn.com/coach/70?ref=app And I have finally come up with this code that successfully convert time in 12 hour format with AM and PM to 24 hour format. #"time12" is input value in 12h format like this 11:00 AM time12 = input().split() #After splitting AM/PM, now splitting 11:00 as 11 and 00 and new list is named "time" time = time12[0].split(":") if time12[1] == "AM" and int(time[0])>=10: print (time12[0]) elif time12[1] == "AM" and int(time[0])>=1: print (f"0{time12[0]}") elif time12[1] == "AM" and int(time[0])==0: print (f"00{time12[0]}") else: t = int(time[0])+12 print(f"{t}:{time[1]}") I spent a lot of time trying to solve this medium level challenge. That has created self-doubt in my mind. Is it okay to take so longer to write such small piece of code or I am slower for beginners?? Also if you could suggest something that could help me improve my skill and pace.. I express my gratitude in advance.