Nice way of getting items from two lists

Yermat loic at
Wed Mar 10 19:06:14 CET 2004

SBrunning at a écrit :
>>From: C GIllespie [mailto:csgcsg39 at]
>>I have two equal size lists - list1, list2. Basically, each 
>>item in list 1
>>has a partner in list2. I was wanting to do something like
>>So if:
>>then if I did this 'for loop'
>>for name, value in list1,list2:
>>    print name, value
>>I would get
> for name, value in zip(list1, list2):
>     print name, value

or with itertools.izip


More information about the Python-list mailing list