Military Time challenge
I am having some issues with this challenge. I am failing 2 of the 5 test cases, and I am not sure why. Here is my code: test = input() def military_time(time): time = time.upper() time = time.replace(':', ' ') time = time.split() time[0] = int(time[0]) time[1] = int(time[1]) if time[2] == 'AM' and time[0] == 12: hours = '00' elif time[2] == 'PM' and time[0] != 12: hours = time[0] + 12 else: hours = time[0] if time[1] == 0: minutes = '00' elif 0 < time[1] < 10: minutes = '0' + str(time[1]) else: minutes = time[1] return f'{hours}:{minutes}' print(military_time(test)) I used a for loop to plug in test values and they all seem to work out, but obviously I am overlooking something. If anyone wishes to help, it would be very welcomed!