Q33
What is the order of precedence in python?
A.
Exponential, Parentheses, Multiplication, Division, Addition, Subtraction
B.
Exponential, Parentheses, Division, Multiplication, Addition, Subtraction
AnswerC.
Parentheses, Exponential, Multiplication, Division, Subtraction, Addition
D.
Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
Answer: Option B
Solution
Answer: Option B
Solution:
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.