You want to use a logical and (and not & , which is a bitwise AND operator in Python):
if thing2 == 3 and thing1: print "hi"
Since you used & , the error popped up saying:
TypeError: unsupported operand type(s) for BitAnd: 'bool' and 'number' ^^^^^^
source share