0

Find the error in this 12 to 24 hour clock

s=input("") l=[int(s[0:2]),s[3:5],s[6:8]] if l[0]==12 and l[2]=="AM": print('00'+":"+l[1]) elif l[0]==12 and l[2]=="PM": print(str(12)+":"+l[1]) elif l[2]=="PM": print(str(l[0]+12)+":"+l[1]) else: if l[0]>9: print(str(l[0])+":"+str(l[1])) else: print('0'+str(l[0])+":"+str(l[1]))

2/11/2020 12:22:34 PM

VISHWATEJ

4 Answers

New Answer

+3

VISHWATEJ Write your code in Sololearn Playground and share here so we can check that what Problem you are facing.

+3

Message me privately As others can cheat from here VISHWATEJ

+1

VISHWATEJ From description: Sample Input: 1:15 PM Sample Output: 13:15 Your code fails on that.

0

It's working in the playground , but when i write the same code in actual problem , i am getting errors in the hidden test cases