Help with LALIGA (COOK82A) problem from May Cook-Off

Hi, I am trying to find a test case where my python code might have broke for problem. I have tried all the possible combinations of wins and losses it seems to work fine… could it be an issue because of print function??? :

def accept_input():
    no_of_test_cases= int(input())
    if no_of_test_cases>500:
        exit(10)
    teamBarcelona = []
    teamMalaga = []
    teamRealMadrid = []
    teamEibar = []
    result = []
    def whereDoILand(ip):
        print(ip)
        if ip[0] == "Barcelona" and int(ip[1])<=20:
            teamBarcelona.append(ip)
        elif ip[0] == "Malaga" and int(ip[1])<=20:
            teamMalaga.append(ip)
        elif ip[0] == "RealMadrid" and int(ip[1])<=20:
            teamRealMadrid.append(ip)
        elif ip[0] == "Eibar" and int(ip[1])<=20:
            teamEibar.append(ip)

def whoWonTheGame(idx):
    if int(teamRealMadrid[i][1])<int(teamMalaga[i][1]) and int(teamBarcelona[i][1])>int(teamEibar[i][1]):
        result.append("Barcelona")
    else:result.append("RealMadrid")


for i in range(0,no_of_test_cases):
    ip = input()
    whereDoILand(ip.split(" "))
    ip = input()
    whereDoILand(ip.split(" "))
    ip = input()
    whereDoILand(ip.split(" "))
    ip = input()
    whereDoILand(ip.split(" "))

for i in range(0,no_of_test_cases):
    whoWonTheGame(i)

return result


result=accept_input()
for winner in result:
    print(winner)

You are storing the result of an “accept_input” function in “result”. therefore your code prints the input to stdout. But while working on online judges You should output the expected output in a specified format only then your code will be accepted.
You can refer to these links:-

Sample solutions

Tutorial for input/output