Tuple

In short: A tuple is an ordered collection of a fixed number of values, which can have different types, like (17, 3, "My name is Parker"). In Python, tuples are immutable, so you can't change their items after creation, which also lets them be used as dictionary keys.

A tuple is a list of elements:

(17, 3, "My name is Parker")

(Tuples are usually notated with parentheses to differentiate them from arrays.)

Like arrays, tuples are ordered and you can access elements by their index:

cake_tuple = ('angel', 'bundt') cake_tuple[0] # returns: 'angel'

But tuples are immutable! They can't be edited after they're created.

cake_tuple = ('angel', 'bundt') cake_tuple[1] = 'carrot' # raises: TypeError: 'tuple' object does not support item assignment

Tuples can have any number of elements (the 'tu' in tuple doesn't mean 'two', it's just a generic name taken from words like 'septuple' and 'octuple').

(90, 4, 54) (True, False, True, True, False)

Frequently Asked Questions

What is a tuple?

An ordered, fixed-length group of values, written like (90, 4, 54). Unlike an array, a tuple's elements can have different types.

What's the difference between a list and a tuple in Python?

Lists are mutable and can grow or shrink; tuples are immutable. Because they're immutable (and hashable if their contents are), tuples can be used as dictionary keys or set members.

Does 'tuple' mean two items?

No. A tuple can have any number of elements; the name comes from words like quintuple and septuple, not from 'two.'

Last updated: October 21, 2026

What's next?

If you're ready to start applying these concepts to some problems, check out our mock coding interview questions.

They mimic a real interview by offering hints when you're stuck or you're missing an optimization.

Try some questions now

. . .