🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Tuples and Sets: all 15 questions

Quiz: Tuples and Sets · Question 12 of 15

What is the easiest way to remove duplicates from a list names when order does not matter?

What is the easiest way to remove duplicates from a list names when order does not matter?

  1. A.names.unique()
  2. B.names.remove_duplicates()
  3. C.list(set(names))
  4. D.tuple(names)
Answer & explanation

Correct answer: list(set(names))

A set keeps only one copy of each value; convert back to a list if you need one.

Can you get the rest right without peeking?

Take the timed Quiz: Tuples and Sets quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →