Vidyalelo
Python · Q27

Python Operator Precedence: MCQs for Exam Prep

Programming · Python · question 27

Q27

What is the result of 4 + 3 ** 2 % 2 ?

A.
4
B.
5
Answer
C.
1
D.
7

Answer: Option B

Solution

Answer: Option B
Solution:
Exponentiation has higher precedence, so 3 ** 2 is evaluated first, then modulo, and finally addition.