What context can I use each word in?
Learn when and how to use these words with these examples!
tuple
Example
The tuple (1, 'apple', True) represents a number, a string, and a boolean value. [tuple: noun]
Example
We can unpack the tuple into separate variables using x, y, z = (1, 2, 3). [tuple: noun]
array
Example
The array [1, 2, 3] represents a collection of integers. [array: noun]
Example
We can access the third element of the array using my_array[2]. [array: noun]
Good things to know
Which word is more common?
Array is more commonly used than tuple in computer programming, especially for large datasets and mathematical structures. Tuple is less common but still useful for smaller sequences and grouping related data together.
Whatโs the difference in the tone of formality between tuple and array?
Both tuple and array are formal terms used in computer programming and are not typically used in everyday language.