望采纳最后一行代码输出的部分修改一下format使用方式,示例如下:
word = "hello" count = 5 print("{} 出现 {} 次".format(word, count))
输出结果:
hello 出现 5 次
你也可以使用f-strings(在python3.6及更高版本中可用)来输出两个变量的值,例如:
word = "hello" count = 5 print(f"{word} 出现 {count} 次")
应该要将最后一条改一下,把[]改成{}