1. Home
  2. Data Science
  3. Python
  4. What is the result of 2

Added 4 May 2024

What is the result of 2 << 3 in Python?

  1. 6
  2. 8 Correct answer
  3. 14
  4. 64

Correct answer

B. 8

15 views

MCQSEXAM

Explanation

The << operator performs a left shift operation, shifting the bits of the first operand to the left by the number of positions specified by the second operand.

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