I want to create a "real" dictionary: a Dutch to English dictionary with the following words: def reversTranslation(dictionary):
>>> dictionary= {'tension': ['spanning'], 'voltage': ['spanning', 'voltage']}
>>> dictionary= reverseTranslation(dictionary)
>>> dictionary
{'spanning': ['tension', 'voltage'], 'voltage': ['voltage']}
As you can see in dutch 'spanning' has two different meanings in English. Help will be appreciated.
Note: collections are available only from python 2.4 and later
If you are asking how to obtain that result, the most readable way is:
Or you can first sum up the values and then iterate on the dictionary.
Here you go: