理解并掌握:字典统计。本课不是占位内容,示例和练习都围绕这个知识点。
text = 'apple' count = {} for ch in text: count[ch] = count.get(ch,0)+1 print(count)
请根据本课知识,自己写一段包含检查点的代码。
检查点:print, for, get, 字典