I have a case where I have to use if statement learning python:
if ([Team1_matches[0]>Team2_matches[0] and Team1_matches[1]>Team2_matches[1] and Team1_matches[2]>Team2_matches[2] and
Team1_matches[3]>Team2_matches[3] and Team1_matches[4]>Team2_matches[4]]):
winner="Team 1"
elif ([Team2_matches[0]>Team1_matches[0] and Team2_matches[1]>Team1_matches[1] and Team2_matches[2]>Team1_matches[2] and
Team2_matches[3]>Team1_matches[3] and Team2_matches[4]>Team1_matches[4] ]):
winner="Team 2"
else:winner="it was a draw or something went wrong"
It's always returning team 1 for some reason due to my poor combination, please advice how I can achieve the real value for winner, without having to if for many lines, if this is programmatically correct I will do it, just need advice
Without the braces
if Team1_matches[0]>Team2_matches[0] and Team1_matches[1]>Team2_matches[1] and Team1_matches[2]>Team2_matches[2] and
^
SyntaxError: invalid syntax
I am getting the input this way:
Team1_matches[0] = input("Enter the score that team 1 got on match 1? ")