Python lists help

Hello,

I am trying to solve a seemingly simple python problem:

I am having two lists.

L1 = ["b","a","b","a"]
L2 = ["1","2"]

now I want to connect the two lists in a way that L1[0] = L2[0] and L1[1] = L2[1]

so in the end i get for every item in L1 the proper value out of L2.

b = 1 and a = 2

the best would be a dict where the values are connected.

dict = {"b" : "1" , "a" :"2" ,"b" : "1" , "a" : "2"}

but i am open to any way to get this done…

jaden

No Responses to “Python lists help”

Post a Comment