Possible Duplicate:
Python program to split a list into two lists with alternating elements
Problem
Given a list like this:
list1 = [blah, 3, haha, 2, pointer, 1, abcd, fire]
I expect to get this output:
list = [3, 2, 1, fire]
So what I want is to make a list of even elements of the former list.
What I tried
I tried using a for
statement and tried to delete 2nd element while appending them to the list, but it didn't work out:
count = 0
for a in list1:
list2.append(a)
if count % 2 = = 1:
list2.pop(count)
print list2