Lists: Accessing Items
Syntax: list[index]
- Indexing from the left starts at 0
- E.g.
>>> l = [1, ["2", 4], 3.0]
>>> l[0]
1
>>> l[2]
3.0
>>> l[1]
['2', 4]
>>> l[3] = 4
Traceback (most recent call last):
File "", line 1, in ?
l[3] = 4
IndexError: list assignment index out of range