Extracting elements over multiple lists?

JoeM josephmeiring at gmail.com
Mon Nov 7 12:12:13 EST 2011


Howdy,

If I have a few lists like

a=[1,2,3,4,5]
b=["one", "two", "three", "four", "five"]
c=["cat", "dog", "parrot", "clam", "ferret"]

what is the most pythonic method of removing the first element from
all of the lists?

A list comprehension such as [arr[1:] for arr in a,b,c]
gives a single 2d list, which is not what I'm shooting for. Any
suggestions?







More information about the Python-list mailing list