mardi 7 juillet 2015

Asking multiple things in an if statement?

im new to StackOverflow and Python, I am working on my first program that is not hello world, it is a simple rock, paper, scissors game.

So, my question is can you ask multiple things in an if statement? quick sample

sport = raw_input("Whats a good sport?")
if sport == 'Football','Soccer','Hockey':
   print 'Those are fun sports!'
elif sport != 'Football','Soccer','Hockey':
print 'I dont like those sports!'

I know there are ways to fix that code but I am curious as to if that is a thing?

Aucun commentaire:

Enregistrer un commentaire