A-A+
设将单词保存在变量wond中 使用一个字典类型countis ={}统计单词出现的次数 可采用以下代码
问题详情
设将单词保存在变量wond中,使用一个字典类型countis ={}统计单词出现的次数, 可采用以下代码
A.counts[ word] = count[word] + |
B.counts[ word] = 1
C.counts[ word] = count.get(word,0) + 1
D.counts[ word」= count.get(word,1) + 1
参考答案
counts[word] = counts.get(word,0) + 1