1. Home
  2. Data Science
  3. Python
  4. What is the average time complexity of a dict lookup in…

Added 25 Nov 2026

What is the average time complexity of a dict lookup in Python?

  1. O(n)
  2. O(log n)
  3. O(1) Correct answer
  4. O(n log n)

Correct answer

C. O(1)

11 views

MCQSEXAM

Explanation

Dictionaries are hash tables with average constant-time lookup.

Reference

Asked in: Python Interview Dictionaries

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

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