Create multidimensional list in python through two other lists -


i have 2 lists , want create new one.

for instance

a = ["street zero", "street one", "street two"] b = [0,1,2]  newlist [0][0] = "street zero" newlist [1][1] = "street one" newlist [2][2] = "street two" 

how can achieve ?

thanks

do mean enumerate?

>>> list(enumerate(a)) [(0, 'street zero'), (1, 'street one'), (2, 'street two')] 

or zip:

>>> zip(b, a) [(0, 'street zero'), (1, 'street one'), (2, 'street two')] 

(that uses items b indexes)


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -