Mega Code Archive

 
Categories / Python Tutorial / List
 

If the slice continues to the start of the sequence, you may simply leave out the first index

numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] numbers[:3]