Mega Code Archive
Categories
/
Python Tutorial
/
List
If you want every fourth element of a sequence, you only have to supply a step size of four
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] print numbers[::4]