I would like to create variables from 2 lists in python. One list contains the variable names, the other list contains the variable values, like this:
lst1 = [a, b, c]
lst2 = [1, 2, 3]
a = 1
b = 2
c = 3
This following code does not work unfortunately:
for i, j in zip(lst1, lst2):
i = j
New contributor
Erik Swiers is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2