🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
Back to Python Notes
Topic #34

Operator Precedence


Operator Precedence

Operator precedence describes the order in which operations are performed.

Example

print((6 + 3) - (6 + 3))

Example

print(100 + 5 * 3)

Precedence Order

The precedence order is described in the table below, starting with the highest precedence at the top:

Operator Description Try it
() Parentheses
** Exponentiation
+x -x ~x Unary plus, unary minus, and bitwise NOT
* / // % Multiplication, division, floor division, and modulus
+ - Addition and subtraction
<< >> Bitwise left and right shifts
& Bitwise AND
^ Bitwise XOR
| Bitwise OR
== != > >= < <= is is not in not in Comparisons, identity, and membership operators
not Logical NOT
and AND
or OR

Left-to-Right Evaluation

If two operators have the same precedence, the expression is evaluated from left to right.

Example

print(5 + 4 - 7 + 3)

Want to go beyond the notes?

Join CodingNow 2.0's Python course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

Operator Precedence – FAQs

Quick answers about learning Operator Precedence in Python.

This free note from CodingNow 2.0 explains Operator Precedence in Python — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every Python topic on CodingNow 2.0, including Operator Precedence, is 100% free with no signup required.
With focused practice, most students grasp Operator Precedence in 1–3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) — expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now