Military time | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 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 Resposta
- 1
~ swim ~ What is the meaning of i.e?
26th Jun 2020, 2:51 PM
Emanuel MaliaƱo
Emanuel MaliaƱo - avatar