mardi 23 février 2016

If variable is not equal to "a" or "b" or "c" (Python) [duplicate]

This question already has an answer here:

How do i check if the variable is not equal to a b or c together in one row?

Example:

if playerHand != "R" or "P" or "S":
   print(playerHand,"is not defined.")

Is it even possible? I'm screwing up on the easiest things i think T_T.

Thanks!

Aucun commentaire:

Enregistrer un commentaire