1. Home
  2. Data Science
  3. Python
  4. Which data structure in Python is best for fast membership…

Added 25 Nov 2026

Which data structure in Python is best for fast membership checks?

  1. list
  2. set Correct answer
  3. tuple
  4. str

Correct answer

B. set

6 views

MCQSEXAM

Explanation

Sets use hash tables, giving average O(1) membership testing.

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 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