1. Home
  2. Data Science
  3. Python
  4. What is the result of 5 // 2 in Python?

Added 4 May 2024

What is the result of 5 // 2 in Python?

  1. 2.5
  2. 2 Correct answer
  3. 3
  4. 2.0

Correct answer

B. 2

16 views

MCQSEXAM

Explanation

The // operator performs integer division, discarding any fractional part. So, 5 // 2 equals 2.

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