Mega Code Archive
Categories
/
Python Tutorial
/
List
If the slice continues to the end of the sequence, you may simply leave out the last index
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] numbers[-3:]