tutorial |
---|
The only way of accessing a particular element in an list
(in python), is using an index.
An index
is an integer number that represents the position
you want to access in the list.
You need to wrap
the index into brackets
like this:
my_value = list[index]
-
Print on the console the 1st element of the list
-
Print on the console the 4th element of the list