0
Military time challenge (Python)
My code works for all cases but the fourth one. I think it may have something to do with the "XX:XX" format, but when I try to modify the code for the < 10 times, it works just in two cases. I'd appreciate any help :) https://code.sololearn.com/c2apZ4lXLuSm/?ref=app
7 Antworten
+ 2
Look at mine if it helps:
https://code.sololearn.com/cZ7e4UBelPnC/?ref=app
+ 2
Check if you have 1:35
must be 01:35
+ 1
your problem is around 12:00PM to 12:59PM should convert to 12:00 to 12:59, in military time we start from 00:00(12:00AM) to 23:59 (11:59PM) we dont have 24 in it
+ 1
Yeah, you need extra zero before single digit as Shadoff mentioned it Shadoff
0
Mehrdad Sh Shadoff I modified my code with both of your suggestions and it works fine in the playground, but it still fails the 4th case in the actual challenge. I don't know what's wrong :/
https://code.sololearn.com/c3z1df6hI0V7/?ref=app
0
Shadoff Thanks a lot!! I finally solved it
https://code.sololearn.com/c3z1df6hI0V7/?ref=app