What I want is, based on a raw_input question and list provided I want a print result related to an item chosen from a list( i.e football, rugby, basketball etc.)
I would be grateful if someone could help me with it
balls = ['Basketball', 'Football', 'Golf', 'Tennis', 'Rugby']
others = ['Hockey', 'Chess', 'Poker']
raw_input("Please chose a sport you want to play: ")
for x,y in zip(balls,others):
if x == balls.choice():
print "You have chosen a sport with balls!"
else:
print "You have chosen others" `
You could just assign the
raw_input
to a variable and check if the variable is inballs
ornot in balls
: