How to debug code?

I have written code in python and run with codechef IDE. It run perfectly. But when submitted, it gives me wrong answer. Does’t give any information in submission so I can debug. Can any one give me any hint?

If the result is WA, it means your code is failing in some test cases. You should debug your code in your local machine. Like try giving some small, random inputs (Of course, they should obey Constraints) and find whether your code gives the expected output. If you feel your code is correct then try submitting. Wait for the result, if still WA, debug again. If AC, continue with next problem.

PS: There’s no way you can view the test cases of a Problem in Codechef. You should try it yourself.