+ 3
Military time
What is wrong in this program. Only 3 test cases executed and 2 cases did notđ . This question is from code coach solve military time medium level. t = input() hour = 0 if t[1] == ':': hour = int(t[0]) else: hour = int(t[0:2]) if t[len(t)-2:] == 'PM': if hour < 12: hour += 12 elif hour <= 12: hour = hour else: pass total_time = str(hour) + ':' + t[len(t)-5:len(t)-3] print(total_time) Note : there is not any compile time error.
1 Answer
- 1
~ swim ~ What is the meaning of i.e?