Lists

A list is an ordered, mutable sequence of elements, written between square brackets. You access elements by index (starting at 0) or by slice, and modify it with append, insert, remove or pop. It can contain elements of different types.

Example

fruits = ['pomme', 'poire']
fruits.append('kiwi')
fruits[0]  # 'pomme'

Related concepts

The whole glossary