【发布时间】:2020-10-12 16:59:52
【问题描述】:
我正在学习 Python,目前我有一个文本文件。在该文本文件中,我想在列表 ['mice', parrot'] 中搜索我已经拥有的单词,并计算老鼠和鹦鹉被提及的次数。我目前有。
enter code herewith open('animalpoem.txt', 'r') as animalpoemfile:
data = animalpoemfile.read()
search animals = ['mice', parrot']
【问题讨论】:
-
您可能会在这里找到答案:*.com/questions/4783899/…
标签: python