Vidyalelo
Python · Q46

Python Operator Precedence: MCQs for Exam Prep

Programming · Python · question 46

Q46

What is the result of 5 % 3 ** 2 ?

A.
1
B.
2
C.
0
Answer
D.
4

Answer: Option C

Solution

Answer: Option C
Solution:
Exponentiation has higher precedence, so 3 ** 2 is evaluated first, then modulo.