What are the collection types we have in Python?
1Times asked
Jul 2026Last seen
Jul 2026First seen
💡 Model Answer
Python provides several built‑in collection types:
- List – ordered, mutable, allows duplicates. Syntax:
[1, 2, 3]. - Tuple – ordered, immutable, allows duplicates. Syntax:
(1, 2, 3). - Set – unordered, mutable, no duplicates. Syntax:
{1, 2, 3}. - Dictionary – unordered (Python 3.7+ preserves insertion order), mutable, key‑value pairs. Syntax:
{'a': 1, 'b': 2}. - FrozenSet – immutable set.
Additionally, the collections module offers specialized collections such as namedtuple, deque, defaultdict, and OrderedDict. These extend the basic types with useful semantics for specific use‑cases.
This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.
🎤 Get questions like this answered in real-time
Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers on a discreet on-screen overlay.
Get Assisting AI — Starts at ₹500