I have simple dictionary with key, value:
d = {\'word\': 1, \'word1\': 2}
I need to add another value (to make a list from values):
It will be easiest if you always use lists, even when you just have a single value. It will just be a list of length 1.
>>> d = {'a': [1], 'b': [2]} >>> d {'a': [1], 'b': [2]} >>> >>> d['a'].append(5) >>> d {'a': [1, 5], 'b': [2]}