Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Like strings (and all other built-in sequence type), lists can be indexed and sliced:

>>> squares[0]  # indexing returns the item
1
>>> squares[-1]
25
>>> squares[-3:]  # slicing returns a new list
[9, 16, 25]
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #Like #strings #sequence #lists #indexed
ADD COMMENT
Topic
Name
9+2 =