我有一个包含以下数据的表: Snack ID | Child | Fruit
1 Child A Apple
2 Child B Orange
3 Child A Banana
4 Child A Orange
5 Child C Banana
6 Child A Banana
7 Child C Banana
8
我有一个文本字符串,从中提取可能出现在其中的特定单词(成果);相应的单词存储在一个集合中。(实际上,集合非常大,但我试图简化代码)。我用这个简单的代码实现了提取单个水果单词:
# The text string.
text = """
My friend loves healthy food: Yesterday, he enjoyed
an apple, a pine apple and a banana. But what he
likes most, is a blueberry-orange cake.
"""
# Remove n