+ 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! 🙏🏼
5 Antworten
+ 3
input 1:30 AM to see your problem.
Good luck, & well done
+ 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! 😊👍🏽
+ 2
Gayatri C 😁👍
+ 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!