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?