题解 | 字母统计
字母统计
https://www.nowcoder.com/practice/de7bf0945c1c4bd1aa9d49573b831f3c
def tongji(s): res = {} for i in range(26): w = ord('A') + i w = chr(w) res[w] = 0 for j in s: for i in range(26): if ord(j) == ord('A') + i: res[j] += 1 return res s = input() res = tongji(s) for i, j in res.items(): print('{}:{}'.format(i,j))