题解 | #使用字典计数#
使用字典计数
https://www.nowcoder.com/practice/74f7e7f2344f4754bc56d862838cbfc3
word = input() d = {} for i in word: if i not in d: d[i] = 1 else: d[i] += 1 print(d)
使用字典计数
https://www.nowcoder.com/practice/74f7e7f2344f4754bc56d862838cbfc3
word = input() d = {} for i in word: if i not in d: d[i] = 1 else: d[i] += 1 print(d)
相关推荐