I'm making a ranking system, and I was wondering if you could use an input to select an item from a list. And if the input matches any item in the list, you could assign points to it.
Here's what I got so far:
teams = list()
scores = list()
#adding a team
if loop=="1":
team_name = input("Enter a team name: ")
print ("This team is succesfully added!")
teams.append(team_name)
#selecting the team by user input
elif loop=="4":
test = input("Enter a team name: ")
if test is any in list(teams):
score_team = int(input("How many points does this team get? "))
scores.append(score_team)
else:
print("Sorry, thats not a valid team name!")
I always get the output:
Sorry, thats not a valid team name!.
What am I doing wrong?