Created
December 9, 2014 14:20
-
-
Save sdvcrx/53bad475ab257c8db09b to your computer and use it in GitHub Desktop.
把重复数字出现的次数按从多到少排列打印出来
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import Counter | |
num = "135481963636" | |
n = Counter(num) | |
for key, freq in n.most_common(): | |
print("{0}: {1}".format(key, freq)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment