Winning CB Scholarship Problem

Here is my code


Out of 6 testcases, I am getting first 3 testcases wrong and last 3 as correct on hackerblocks!!
What is the issue in my code?