Operator precedence problem

Gregory Ewing greg.ewing at canterbury.ac.nz
Mon Jun 6 19:27:34 EDT 2016


MRAB wrote:

> In Pascal, "and" has the same precedence as "*" and "or" has the same 
> precedence as "+".

Which was annoying, because it gave them higher precedence
than the comparison operators, so instead of

    a = b and c > d

you had to write

    (a = b) and (c > d)

-- 
Greg


More information about the Python-list mailing list