Imagine that you have:
keys = ['name', 'age', 'food']
values = ['Monty', 42, 'spam']
What is the simplest way to produce the following dictionary?
a_dict = {'name' : 'Monty', 'age' : 42, 'food' : 'spam'}
Imagine that you have:
keys = ['name', 'age', 'food']
values = ['Monty', 42, 'spam']
What is the simplest way to produce the following dictionary?
a_dict = {'name' : 'Monty', 'age' : 42, 'food' : 'spam'}
A more natural way is to use dictionary comprehension