I have a simple for loop
for m in my_list:
x = my_function(m)
my_dictionary = {m:x}
my_function()
gives me a string. And if I use print my_dictionary
at the end i get
{m1: string1}
{m2: string2}
I want to be able to have one dictionary at the end.
I have tried several methods that I found in other threads.
dic = dict(my_dictionary, **my_dictionary)
dic = my_dictionary.copy()
dic.update(my_dictionary)
But overtime I just get the last dictionary instead of all dictionaries.
I wish I could just add them with +
, but you can't do that in python