elegant python style for loops

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Thu May 10 16:34:27 EDT 2007


ian.team.python at saltmob.com a écrit :
> To step through a list, the python style is avoid an explicit index.
> But what if the same hidden index is to be used for more than one list
> 
> for example:-
>  for key,value in listKeys,listValues :
>      newdict[key]=value

newdict = dict(zip(listKeys, listValues))



More information about the Python-list mailing list