So I've a dictionary, I'll call it (a), and I run a loop to sort several other dictionaries throughout the keys of the (a) based on the specific tag each of them has, but this is irrelevant. The problem is, every time the loop runs, the dictionary gets updated, and the previous value gets replaced by the new one. What I want is, I want the loop to keep adding values to the (a) if it finds any new ones, not replace the original value. I tried this:
dictionary[i] = smalldict
where i is the key needed, and smalldict is the smaller dictionary that I cycle through with a for loop. Whenever this line of code runs, the previous value of smalldict gets replaced by the new one. How do I make it 'append' the newly found value to the key of the dictionary without removing the old one?
tl/dr: How to make a dictionary keep its original values and add in the new ones?
Thanks!