Getting wrong answer when submitting Code | Chef and Table Tennis | Python | Please help

i wrote a code for problem [Chef and Table Tennis][1] and it is showing right answer for all examples given in question but whenever i submit this code in codechef i get Result = ‘wrong answer’.



Logic which i used is that i found what are the ways in which chef can win. 

1)he can win if he scores greater than 10 and his opponent score less than 10

2)he can win if he score greater than 10 and his opponent score greater than 9 and chef also score 2 more than his opponent

3)else chef loss

Please Help Thanks in advance
hoping for answer


I see you’ve solved the problem. So, congratulations…

No no i have solved using different code and logic. But i want to know whats wrong in this particular code and logic. This code is still showing wrong answer. Help me with this code

You missed an ‘else’ statement!

If ‘a1-a2 == 2’ is false, the code was not printing anything.

Thanks bro i got it :slight_smile: