In this lesson, you’ll see how to access individual elements and sequences of objects within your lists. Lists elements can be accessed using a numerical index in square brackets: This is the same technique that is used to access individual characters in a string. List indexing is also zero-based: >>>
List elements can also be accessed using a negative list index, which counts from the end of the list: >>>
Slicing is indexing syntax that extracts a portion from a list. If
Here’s an example: >>>
Omitting the first and/or last index:
Here’s an example: >>>
A stride can be added to your slice notation. Using an additional >>> |