Skip to main content
The built-in list type. Example list expressions:
Accessing elements is possible using indexing (starts from 0):
Lists support the + operator to concatenate two lists. Example:
Similar to strings, lists support slice operations:
Lists are mutable, as in Python.

Members

append

Adds an item to the end of the list.

Parameters

clear

Removes all the elements of the list.

extend

Adds all items to the end of the list.

Parameters

index

Returns the index in the list of the first item whose value is x. It is an error if there is no such item. If start and end are given, they restrict the range searched in the same manner as slicing.

Parameters

insert

Inserts an item at a given position.

Parameters

pop

Removes the item at the given position in the list, and returns it. If no index is specified, it removes and returns the last item in the list.

Parameters

remove

Removes the first item from the list whose value is x. It is an error if there is no such item.

Parameters