Skip to content
BENIBIX Learn

Tuple vs Array

A tuple is a small, fixed group where each spot has a meaning, like x and y. An array, or list, is a row of items of the same kind that can grow and change.

Development🧩 Programming Concepts

Tuple

A small, fixed group of values in order. It usually cannot be changed.

A tuple is a small, fixed group of values kept in order. Once made, it usually cannot be changed. Each spot often means something, like the x and y of a point. Python writes a tuple with round brackets, like (3, 4). A function can return a tuple to hand back two or three values at once.

Example
A map app stores a spot as (51.5, -0.1), the latitude and longitude of London.
Why it matters
A tuple says these values belong together and will not change. That guards against a slip that edits one by mistake.
Full entry
Development🧩 Programming Concepts

Array

A row of values kept together under one name. Each sits in a numbered spot.

An array is one value that holds many values in a row. Each item sits in a numbered spot, and the count starts at zero. You can add items, take them out, sort them or go through them one by one. Python calls its array a list. Arrays are the most common way to keep many things of the same kind together.

Example
A to-do app keeps Lucy's tasks in an array. Item 0 is buy milk, item 1 is call Jack.
Why it matters
Programs rarely deal with just one thing. Lists of users, songs and orders are all arrays.
Full entry

In one line

Tuple
A small, fixed group of values in order. It usually cannot be changed.
Array
A row of values kept together under one name. Each sits in a numbered spot.