+ 1

Can someone please help here with Military time converter. Hidden test cases 3 & 5 failed. Please help in knowing the error

Have written a very simple logic, when I test with all cases it works fine. Not sure of input in test cases 3 & 5. Below is my code - https://code.sololearn.com/c4N3roZoh4Go/?ref=app Please let me know how could I get to know those hidden cases when something doesn't work for. Thank you! 🙏🏼

21st Apr 2021, 4:56 AM
Gayatri C
Gayatri C - avatar
5 Antworten
+ 3
input 1:30 AM to see your problem. Good luck, & well done
21st Apr 2021, 5:31 AM
Rik Wittkopp
Rik Wittkopp - avatar
21st Apr 2021, 5:33 AM
˜”*°•.˜”*°• Mohan 333 •°*”˜.•°*”˜
˜”*°•.˜”*°• Mohan 333 •°*”˜.•°*”˜ - avatar
+ 2
Thanks Rik Wittkopp , Mohan 333 That was the case I somehow missed Have added one check as below, elif int(hour) < 10: hour = ('0{}'.format(hour)) and it worked! 😊👍🏽
21st Apr 2021, 5:47 AM
Gayatri C
Gayatri C - avatar
+ 2
Gayatri C 😁👍
21st Apr 2021, 8:21 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 2
Have modified logic for single digit hours acceptance. Whenever I tested earlier, I was providing input as two digit number in place of hour. That was the main reason I couldn't catch that bug. 😊 Now, modified code works perfectly! Thanks all for being a great team!
21st Apr 2021, 1:23 PM
Gayatri C
Gayatri C - avatar