Python Program to Slice Lists (Get all the Items from One Position to Another Position)

bookmark

my_list = [1, 2, 3, 4, 5]

print(my_list[2:4])

 

Output

[3, 4]