I have a dict that looks like this
{ \"keyword1\":3 , \"keyword2\":1 , \"keyword3\":5 , \"keyword4\":2 }
And I would like to convert it DESC and
I would come up with something like this:
[k for v, k in sorted(((v, k) for k, v in theDict.items()), reverse=True)]
But KennyTM's solution is much nicer :)