Vidyalelo
Python · Q34

Python Operator Precedence: MCQs for Exam Prep

Programming · Python · question 34

Q34

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

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

Answer: Option C

Solution

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