Definition, Meaning & Synonyms
tuple
noun
/ˈtʌp.əl/

Definition
A tuple is an ordered collection of elements or values that are usually of different types. Unlike lists in some programming languages, tuples are immutable, meaning they cannot be changed after they are created.

Examples
- In Python, a tuple can be created by placing values in parentheses, like this:
(1, 'apple', 3.14)
. - A coordinate can be represented as a tuple, for example,
(10, 20)
. - When returning multiple values from a function, they can be returned as a tuple.

Meaning
In mathematics and computer science, a tuple is similar to a list, but it is used to group together related data items. Each item in a tuple can be of any data type, and the order in which the items are listed is significant.

Synonyms
- pair
- group
- set