Using lists lets you store multiple items in a single variable. You can access portions of a list in Python using a feature called slicing.
Slicing lets you extract a sequense of elements without modifying the original list.
Basic Slicing Syntax

The start parameter represents the index where the slice begins. The extracted portion includes this index.
The end parameter represents the index where the slice stops. The sliced part does not include this index.
Example:

Omitting Start or End
You can leave out either side to let Python fill in the rest.
From the beginning:

Until the End:

Entire copy of the list:

Using Step Values
You can slice with a step using a third number:

Example: Every second item

Reverse the list:

Negative Indexing in Slices
Python lets you count from the end using negative numbers:

This works exactly like positive indexing but starts from the list’s tail.
Practical Examples
A portion in the middle:

Removing front and back:

Taking the first half:

Quick Summary
- Use
list[start:end]for simple slicing - Use a third value for step:
list[start:end:step] - Negative indexes start counting from the end
- Omitting values makes slicing cleaner and more flexible
Concluding
In Python, when dealing with lists, we frequently need to extract certain elements. The easiest method to do this is by referencing the index. By utilizing the index, we can employ a feature called slicing that enables us to pull a range of elements from a list without changing this list.