Vidyalelo
Python · Q33

Python Introduction and basic

Programming · Python · question 33

Q33

What is the order of precedence in python?

A.
Exponential, Parentheses, Multiplication, Division, Addition, Subtraction
B.
Exponential, Parentheses, Division, Multiplication, Addition, Subtraction
Answer
C.
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.