Hi, i need to test if the user input is the same as an element of a list, right now i'm doing this
cars = ("red","yellow","blue")
guess = str(input())
if guess == cars[1] or guess == cars[2]:
print ("success!")
But i'm working with bigger lists and my if statement is growing a lot with all those checks, is there a way to reference multiple indexes something like
if guess == cars[1] or cars[2]
I know that doesnt work, i wish i could just do
if guess == cars[1,2,3]
Reading the lists docs i saw that it's impossible to reference more than one index like i tried above and of course that sends a syntax error. Any help appreciated.