freqDict = eval(input())
for word in input().split():
freqDict[word] = freqDict.get(word, 0) + 1
print(freqDict)
使用字典来统计词频
最新推荐文章于 2023-12-24 23:29:58 发布
freqDict = eval(input())
for word in input().split():
freqDict[word] = freqDict.get(word, 0) + 1
print(freqDict)