In Python I want to assign values to certain variables by putting them first in a list and assigning them values by indexing. For example:
I want to assign x = 1, y = 2, z = 3.
Rather than coding it one by one, I want to assign the variables as follows:
list_variables = [x, y, z]
list_values = [1, 2, 3]
for i in range(0, 3):
list_variables[i] = list_values[i]
However it does not work. This type of assigning would really make my life easier because I am having hard time loading saved data to my variables by the pickle.load method. Thank you.