You are viewing a single comment's thread. Return to all comments →
I have written the same login in python.
t = time.rstrip('APM').split(':')
t = int(t)
t = t % 12
if 'PM' in time:
t += 12
t = str(t)
time = ':'.join(t)
For me it is not able to paas all the test. Its saying it is failing on 12:40:22AM. But when I am testing the output it seems working fine.
I have the same issue. should pass, but showhow fails that test.
For 12:00:00PM the answer should be 12:00:00
Your code gives 24:00:00 which is incorrect. For "PM" case, don't add 12 if the hour is 12