Combinate 2 lists to a dict ?

Bart Willems b.r.willems at gmail.com
Wed Apr 18 11:29:22 EDT 2007


Jia Lu wrote:
>  I have 2 lists,
>  a = [1,2,3]
>  b = ["ooo","aaa","ppp"]

reading the documentation might help.

If that doesn't work, try d = dict(zip(a, b))



More information about the Python-list mailing list