What is the order of precedence in python?
A. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction
B. Exponential, Parentheses, Division, Multiplication, Addition, Subtraction
C. Parentheses, Exponential, Multiplication, Division, Subtraction, Addition
D. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
Answer: Option B
Solution (By Examveda Team)
Operators with higher precedence are evaluated before operators with lower precedence. When operators have the same precedence, they are evaluated from left to right.Therefore, the correct order of precedence in Python is Exponential, Parentheses, Division, Multiplication, Addition, Subtraction.
it follows PEMDAS Rule
Order Rule Component Operators
1st Parentheses ()
2nd Exponents **
3rd Multiplication and Division *, /
4th Addition and Subtraction +, -