题解 | #使用字典计数#
使用字典计数
https://www.nowcoder.com/practice/74f7e7f2344f4754bc56d862838cbfc3
word = input() dict_list ={} for i in range(len(word)): if word[i] in dict_list.keys(): dict_list[word[i]] = dict_list[word[i]] + 1 else: dict_list[word[i]] = 1 print(dict_list)