题海让大学四年没有难题
白天模式登陆

题目详情

单选题 将文章中的单词保存在列表lstWords中,定义字典变量dicCounts={},利用"for word in lstWords:"对该列表进行遍历,下列哪个选项可以在循环体内实现统计各单词出现次数的功能

A. dicCounts[lstWords] += 1

B. dicCounts[word] += 1

C. dicCounts[word] = dicCounts.get(word,1) + 1

D. dicCounts[word] = dicCounts.get(word,0) + 1

学科:计算机程序设计(Python)(2025春)

时间:2025-04-13 10:03:02

Copyright © 2022 津ICP备2021001502号