I'm trying to make a dictionary with a set number of keys and the values as lists of strings from an already zipped object, like so:
{'FirstKey': ['1234', '5678', '9123'], 'SecondKey': ['null', 'null', 'null']...}
Each string in every values list comes from a different variable, and if I have three variables, I can get the desired result if I manually zip them:
valuesList = zip(finalValue[0], finalValue[1], finalValue[2])
Dictionary = dict(zip(keysList, valuesList))
This works for three variables, but the problem is that the list of variables can differ, and I'm not sure how to make a loop for whatever number. I've tried appending the variables into a list and making a dictionary with the keys and that list, but then the variables become strings and I get:
{'FirstKey': ('finalValue[0]',), 'SecondKey': ('finalValue[1]',)...}
I get an "arg must be a string, bytes or code object" error when I use eval() on the list of variables, so I'm not quite sure what to do. Any help would be appreciated.