for a list, I am going to remove third item, 6th item,9th item,a and so on.
For example for the following list, I am going to remove item 30 and 60. to summarize, How I can locate multiples of 3 in a list and remove them?
This is my code:
comments = [80,20,30,40,50,60]
A = [comments.pop(i) for i, item in enumerate(comments) if i % 3 == 2]
print A
I have two problems: first, A just include 30
[30]
second, I do not know how to subtract A from comments in python.
please help, thank you !