1. Home
  2. Data Science
  3. Python
  4. How do you remove duplicates from a list while ignoring…

Added 25 Nov 2026

How do you remove duplicates from a list while ignoring order in Python?

  1. items.unique()
  2. items.dedupe()
  3. list(set(items)) Correct answer
  4. unique(items)

Correct answer

C. list(set(items))

MCQSEXAM

Explanation

Converting to a set removes duplicates; convert back to a list if needed.

Reference

Asked in: Python Interview Sets

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

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