Python: list slicing

Example:

mylist = [0, 1, 2, 3, 4, 5]
Slicing can extract a portion of a list.

Solution:

print(mylist[2:5])  # Outputs: [2, 3, 4]

Beginner's Guide to Python