get range of items of python list

names = ['Alice', 'Bob', 'Tom', 'Grace']

names[1:3]
# Output:
# ['Bob', 'Tom']

Here is what the above code is Doing:
1. names[1:3] is asking for the elements from the list names starting at index 1 and going up to but not including index 3.
2. names[1:3] is equivalent to names[1], names[2].
3. names[1:3] is equivalent to names[1:3:1].
4. names[1:3] is equivalent to names[1:3:1], which means start at index 1, end at index 3, and increment by 1.