Programming

What is the difference between a list and a tuple in Python?

Short answer

A list is mutable — its contents can be changed after creation — while a tuple is immutable, meaning once created, its contents can’t be modified.

Both are ordered collections that can hold a sequence of items, but this mutability difference shapes how and when each is used.

List

my_list = [1, 2, 3]
my_list.append(4)     # works fine
my_list[0] = 99        # works fine

Written with square brackets, lists support adding, removing, and changing elements after creation.

Tuple

my_tuple = (1, 2, 3)
my_tuple[0] = 99        # raises a TypeError

Written with parentheses, tuples cannot be modified once created. This makes them useful for data that shouldn't change — like fixed coordinates — and they're slightly faster and more memory-efficient than lists as a result. Tuples can also be used as dictionary keys, while lists cannot, since dictionary keys must be immutable.

Last reviewed: September 2026