If you need something really simple, you can use list comprehension:
data = ['dog', 'cat'] my_list = [3423, 77813, 12, 153, 1899] result = [{k:data} for k in my_list] print(result) # [{3423: ['dog', 'cat']}, {77813: ['dog', 'cat']}, {12: ['dog', 'cat']}, {153: ['dog', 'cat']}, {1899: ['dog', 'cat']}]
In addition, here is an example of adding / removing values using a very convenient defaultdict :
from collections import defaultdict my_list = [3423, 77813, 12, 153, 1899] new_list = [] for number in my_list:
What outputs:
[{3423: ['dog', 'cat']}, {77813: ['dog', 'cat']}, {12: ['dog', 'cat']}, {153: ['dog', 'cat']}, {1899: ['dog', 'cat']}]
Using defaultdict is useful here because it initializes every entry in a dictionary with an empty list. If you do not want to do this, you can achieve this using a regular dictionary, as shown in your question, but this requires that you initialize empty lists yourself.