I tried to figure out how to add multiple tuples containing multiple values to the same key in the dictionary. But so far nothing has happened. I can add values to a tuple or list, but I cannot figure out how to add a tuple so that the key now has 2 tuples containing values, as opposed to a single tuple with all of them.
For example, say dictionary = {'Key1':(1.000,2.003,3.0029)}
and I want to add (2.3232,13.5232,1325.123), so that in the end it turns out:
dictionary = {'Key1':((1.000,2.003,3.0029),(2.3232,13.5232,1325.123))}(forgot the set of brackets!)
If someone knows how to do this, I will be grateful for the help, as it really starts to annoy me.
Thank!
Edit: Thanks everyone! Ironically, I tried this, except that at that time I was trying to make the value of multiple lists instead of multiple tuples; when the solution was to simply nest tuples in a list. Ah, the irony.
source
share