Skip to content

Instantly share code, notes, and snippets.

@edison7500
Created November 13, 2019 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edison7500/a30be4f7413cc385754b53b5cf1631c5 to your computer and use it in GitHub Desktop.
Save edison7500/a30be4f7413cc385754b53b5cf1631c5 to your computer and use it in GitHub Desktop.
from pprint import pprint
words = {'Bakkt': 2, 'Telegram': 1, 'Dfinity': 2, '大公司': 5, 'EOS': 2, 'BTC': 7, '开发者': 4, '联盟链': 1, '期货合约': 1, '投资': 3, 'ETH': 2, '安全': 1, '矿业': 3, '交易所': 1, '政策': 1, '公链': 1, '分叉': 1}
# sorted with value
sorted_words = sorted(words.items(), key=lambda x: x[1], reverse=True)
pprint(sorted_words, indent=2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment