I have the following code:
list1 = ['a', 'b', 'c']
dict1 = {}
for item in list1:
dict1.update({"letter": item})
print(dict1)
I want to iterate over the list and add each element into the dictionary with the same key for each element. So in this case, the required output should be:
{'letter': 'a', 'letter': 'b', 'letter': 'c'}
But the output I get is:
{'letter': 'c'}
Only the last element is added to the dict. How can I get the required output?
Thanks in advance.