Imagine that you have:
keys = [\'name\', \'age\', \'food\'] values = [\'Monty\', 42, \'spam\']
What is the simplest way to produce the foll
Solution as dictionary comprehension with enumerate:
dict = {item : values[index] for index, item in enumerate(keys)}
Solution as for loop with enumerate:
dict = {} for index, item in enumerate(keys): dict[item] = values[index]