题解 | #单词统计#
单词统计
https://www.nowcoder.com/practice/0b6df47098e246ad8fc52002dcaea1fa
words_dic={
'word':2,
'while':15,
'for':20,
'if':26,
'else':14,
'print':9,
}
words = input().strip()
if words in words_dic.keys():
words_dic[words]+=1
else:
words_dic[words]=1
print(words_dic)
# 优化:可增加判断,输入的是否全是字母,若存在非字母的字符,则提示用户



