题解 | #使用字典计数#

使用字典计数

https://www.nowcoder.com/practice/74f7e7f2344f4754bc56d862838cbfc3

word = input()
dict_word = {}
for i in word:
     if dict_word.get(i,0)==0:
        dict_word[i] = 1
     else:
        dict_word[i] += 1
print(dict_word)

全部评论

相关推荐

程序员流年:真的别再用外卖+点评了。真的找小厂也费劲,如果你碰壁了可以看我主页,换个好项目,再去试试,给自己找找亮点
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务