I have some code with an if-statement in it, and one of the conditions is a boolean. However, CodeSkulptor says "Line 36: TypeError: unsupported operand type(s) for BitAnd: 'bool' and 'number'". Please help if you can. This is what that piece of code looks like. (I just changed all the variable names and what the if-statement executes)
thing1 = True
thing2 = 3
if thing2 == 3 & thing1:
print "hi"
==has a higher precedence thanand, so nothing will happen.if (foo == 2) and bar, but it's personal preference to add them in if you feel that they make it clearer.