I have a list of 20 items. I want to create a new list than only contains every 5th item of the list.
Here is was I have:
listA=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]
for i in len(range(listA)):
print i
How can I create listB
from listA
using Python? listB
should be equal to [5, 10, 15, 20]
.