In Python is the bitwise ' or ' operator , not logical or . There are a couple of ways you can go about this . The verbose way would be if item 1 or item 2 or item 3 And the terser and generally preferred method in this case would be if item in 1 , 2 , 3 The in returns True if the left object is contained in the right object . Just to head off a common error Python beginners make , these are not valid ways to do it if item 1 or 2 or 3 if item 1 or 2 or 3 This is because logical or evaluates two complete statements , to see if the left or right statement is True . The FAQ on this wiki has a better explanation . EditAnd just a fun FYI about why 123 31 in binary is 012 in binary is 103 in binary is 11 Bitwise or looks at each bit , and if either the left or right object is a 1 , it returns 1 . So since both bits in 3 are 1 , bitwise or returns 11 in binary , which is 3 .