I would like to create a new dictionary from dictionaries.
- all keys in all dictionaries must be present in resulting dictionary
- all keys must be present only once
- value for key is highest value from all values in dictionaries
ex.
d1 = {'a':1, 'b':3}
d2 = {'a':5, 'd':5}
d3 = {'c':2, 'f':1}
d = {'a':5, 'b':3, 'c':2, 'd':5, 'f':1}
Also, I would like keys (that are strings) to be sorted, like in my example. I try with update
. However, it is overwriting existing value with the newest value, not the highest value.