How python uses Compressor to reverse Dictionary
This article will explain in detail how python uses the compressor to reverse the dictionary. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
Reverse the dictionary with a compressor
> m = {'averse: 1,' baked: 2, 'cantilever: 3,' dashed: 4} > m.items () [('a', 1), ('c', 3), ('b', 2), ('d', 4)] > zip (m.values (), m.keys ()) [(1,'a'), (3,'c'), (2,'b'), (4) 'd')] > mi = dict (zip (m.values (), m.keys () > mi {1:' a dictionary, 2: 'baked, 3:' clocked, 4:'d'} about how python uses the Compressor inversion Dictionary "ends here. Hope that the above content can be helpful to you, so that you can learn more knowledge, if you think the article is good, please share it for more people to see.