Split a list into half by even and odd indexes?

Viewed 39116

Possible Duplicate:
Python program to split a list into two lists with alternating elements

I have a list like this:

list1 = [blah, 3, haha, 2, pointer, 1, poop, fire]

The output I want is:

list = [3, 2, 1, fire]

So what I want is to make a list of even elements of the former list. I tried using a for statement and tried to delete 2nth 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

Any suggestions?

3 Answers
Related