Skip to main content

What are lists, tuples, sets, and dictionaries?

Entry Python
Quick Answer List: mutable, ordered, allows duplicates [1, 2, 3]. Tuple: immutable, ordered, allows duplicates (1, 2, 3) - faster than list, used for fixed data. Set: mutable, unordered, unique elements {1, 2, 3} - O(1) membership test. Dict: mutable, key-value pairs, keys must be hashable {key: value}. Choose based on: mutability, order needs, uniqueness, and lookup pattern.

Answer

List: ordered, mutable
Tuple: ordered, immutable
Set: unique elements, unordered
Dictionary: key-value pairs, mutable
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice