标签:blog imp bsp text 字符串 efault form col set
import pprint text = "aaaa bbbb ccc dd ee ff gg h i j kkkk" count = {} for i in text: count.setdefault(i,0) count[i] = count[i] + 1 # pprint.pprint(count) print(pprint.pformat(count))
标签:blog imp bsp text 字符串 efault form col set
原文地址:http://www.cnblogs.com/leisurelyRD/p/7469753.html