Core: learn it Step 5 of 16 on the Python Developer roadmap
Indexing and slicing
Slices like items[1:3] or name[::-1] pull out parts of lists and strings. Negative indexes count from the end, so items[-1] is always the last item.
Core: learn it Step 5 of 16 on the Python Developer roadmap
Slices like items[1:3] or name[::-1] pull out parts of lists and strings. Negative indexes count from the end, so items[-1] is always the last item.