What is the output of print(2 ** 3 ** 2) in Python?
-
A
64
-
B
512
Correct answer
-
C
36
-
D
256
16 views
Explanation
Exponentiation has right-to-left associativity in Python, so 3**2=9, then 2**9=512.
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ