1. Home
  2. Data Science
  3. Python
  4. What is the output of print(2 ** 3 ** 2) in Python?

Added 16 Sep 2025

What is the output of print(2 ** 3 ** 2) in Python?

  1. 64
  2. 512 Correct answer
  3. 36
  4. 256

Correct answer

B. 512

16 views

MCQSEXAM

Explanation

Exponentiation has right-to-left associativity in Python, so 3**2=9, then 2**9=512.

Reference

Asked in: GATE CS, UGC NET

https://docs.python.org/3/reference/expressions.html#operator-precedence

Preparing for an exam?

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs