What is the output of 2 ** 3 ** 2 in Python?
-
A
64
-
B
512
Correct answer
-
C
81
-
D
729
10 views
Explanation
The ** operator is right-associative, so 2 ** 3 ** 2 is evaluated as 2 ** (3 ** 2) = 2 ** 9 = 512.
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ