Feb
05
Python lists help
Posted in: Nuke Plugins & ScriptsHello,
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
Post a Comment