Python Logical Operators Order