Use `and` and `or` instead of `&` and `|`. You don't need to do `== True` Replace `stuff==False` with `not stuff`. Don't use parentheses unless they are needed to change operator precedence, or you are calling a function.