Imagine that you have:
keys = [\'name\', \'age\', \'food\'] values = [\'Monty\', 42, \'spam\']
What is the simplest way to produce the foll
You can also use dictionary comprehensions in Python ≥ 2.7:
>>> keys = ('name', 'age', 'food') >>> values = ('Monty', 42, 'spam') >>> {k: v for k, v in zip(keys, values)} {'food': 'spam', 'age': 42, 'name': 'Monty'}