Code coach failed 2/5 test cases but works on interpreter?
The code coach problem: Convert 12 hour time to 24 hour time. Assume input is a string formatted `XX:XX (AM or PM)â Example input 1:34 PM Example output 13:34 My code is as follows: def clock(n): time = n.split(':') hours = time[0] minutes = time[1].split() ampm = minutes[1] minutes = minutes[0] if ampm == 'AM': if hours == '12': hours = '00' elif ampm == 'PM': if hours == '12': hours = '12' else: hours = str(int(hours) + 12) time = hours + ':' + minutes return time print(clock(input())) Iâve run it on every possible combination I can on Interpreter with no issues. Iâm a beginner but I canât for the life of me figure out why? Version difference? Missed parameter? Can anyone help?