I have a list of string elements like user_contract = ['ZNZ6','TNZ6','ZBZ6']
I have a data set which has nested list structure like data = [[1,2,3],[4,5,6],[7,8,9]]
I want to assign each of the user_contract
strings as variable names for each of the data
nested list, in the respective order.
I know I can do this manually by typing ZNZ6, TNZ6, ZBZ6 = data
. I don't think this is flexible enough, and I would have to manually change this line every time I change the names in user_contract
.
Is there a way where I can make use of the user_contract
variable to assign data to each of its elements?