Atom

Arrays

An array keeps values in order. Use one for a list of scores, notes, or work items when position matters.

Read the first score

Create an array with square brackets and use index zero for its first element.

Atom
scores = [8, 12]
print(scores[0])
Output
8

The first item is 8. The next item is at index 1.

Append a score

Use add() when a new item belongs at the end.

Atom
scores = [8, 12]
add(scores, 15)
print(scores[2])
Output
15

The array grew by one item. See add() for inserting between existing items.