First page Back Continue Last page Overview Graphics

Immutable Lists: Tuple

Tuples are created with (round)

brackets:

>>> t = (0,1,1,2,3,5,8)

>>> t[3]

2

Tuples support only the fundamental functions of the list data type,i.e. the functions which are not changing a tuple.

An empty tuple can be defined with empty brackets ():

e = ();