Military time | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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.

26th Jun 2020, 1:29 PM
Pranit Bhoir
Pranit Bhoir - avatar
1 Answer
- 1
~ swim ~ What is the meaning of i.e?
26th Jun 2020, 2:51 PM
Emanuel Maliaño
Emanuel Maliaño - avatar