题解 | #使用字典计数#
使用字典计数
https://www.nowcoder.com/practice/74f7e7f2344f4754bc56d862838cbfc3
word = input() cnt = dict() for l in word: cnt[l] = cnt.get(l,0)+1 print(cnt)
使用字典计数
https://www.nowcoder.com/practice/74f7e7f2344f4754bc56d862838cbfc3
word = input() cnt = dict() for l in word: cnt[l] = cnt.get(l,0)+1 print(cnt)
相关推荐