题解 | #使用字典计数#

使用字典计数

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

word = input()

static_dict = {}

for letter in word:
    cnt = 0
    for i in range(len(word)):
        if(letter == word[i]):
            cnt = cnt +1

    static_dict[letter] = cnt

print(static_dict)

全部评论

相关推荐

牛客79969855...:简历上面只有实习的话,面试官应该会深挖你的实习,你能应对自如就行,但是被拆穿了会很尴尬,然后就找下一个吧
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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