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

Added 4 May 2024

What is the output of 2 ** 3 ** 2 in Python?

  1. 64
  2. 512 Correct answer
  3. 81
  4. 729

Correct answer

B. 512

10 views

MCQSEXAM

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

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs