Python Practice › List Programs › Program 73
Every other item
Write a Python program to create a list from every second item.
Input
[3, 5, 7, 8, 2, 9, 3, 5, 11]
Output
[3, 7, 2, 3, 11]
Approach
[::2].
Solution
print([3, 5, 7, 8, 2, 9, 3, 5, 11][::2])Output
[3, 7, 2, 3, 11]
Learn the concept
New to this topic? Read the lesson, then come back.