1. Home
  2. Data Science
  3. Python
  4. What is the output of print([3, 1].sort() == [1, 3]) in…

Added 25 Nov 2026

What is the output of print([3, 1].sort() == [1, 3]) in Python?

print([3, 1].sort() == [1, 3])
  1. True
  2. None
  3. False Correct answer
  4. Error

Correct answer

C. False

7 views

MCQSEXAM

Explanation

list.sort() returns None, so the comparison is False.

Reference

Asked in: Python Interview Lists

https://docs.python.org/3/tutorial/datastructures.html

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? 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