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’.

HERE IS MY **


[2]**

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

  [1]: https://www.codechef.com/problems/TTENIS
  [2]: https://www.codechef.com/viewsolution/18658824

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! CodeChef: Practical coding for everyone

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

Thanks bro i got it :slight_smile: