# Operators

The following list summarizes the operator precedences in Python, from lowest precedence (least binding) to highest precedence (most binding).

Within each group, the operators group left to right (except for exponentiation, which groups from right to left).

Unless the syntax is explicitly given, operators are binary.

- Lambda expression:
**lambda**(**lambda**) (**lowest precedence**) - Boolean OR:
**or**(**or**) - Boolean AND:
**and**(**and**) - Boolean NOT:
**not**x (**not**) - Membership tests:
**in**,**not in**(**in**)

Identity tests:**is**,**is not**(**is**)

Comparisons:**<**,**<=**,**>**,**>=**,**<>**,**!=**,**==**(**comparisons**) - Bitwise OR:
**|**(**operator-or**) - Bitwise XOR:
**^**(**operator-xor**) - Bitwise AND:
**&**(**operator-and**) - Shifts:
**<<**,**>>**(**operator-lshift****operator-rshift**) - Addition and subtraction:
**+**,**−**(**operator-add****operator-sub**) - Multiplication, division, remainder:
*****,**/**,**%**(**operator-mul****operator-div****operator-mod**) - Positive, negative:
**+**x,**−**x (**operator-pos****operator-neg**) - Bitwise not (invert):
**~**x (**operator-invert**) - Exponentiation:
******(**operator-pow**) - Attribute reference: x
**.**attribute (**attribute-references**) - Subscription: x
**[**index**]**(**subscriptions**) - Slicing: x
**[**index**:**index**]**(**slicings**) - Function call: f
**(**arguments…**)**(**calls**) - Binding or tuple display:
**(**expressions…**)**(**parenthesized-forms**) - List display:
**[**expressions…**]**(**list-displays**) - Dictionary display:
**{**key**:**datum…**}**(**dictionary-displays**) - String conversion:
**`**expressions…**`**(**string-conversions**) (**highest precedence**)