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)