# 示例代码
text1 = "I like to play basketball and football"
text2 = "I also like to play soccer and tennis"
# 将两段英文转换为列表
list1 = text1.split()
list2 = text2.split()
# 创建一个新的列表
common_words = []
# 遍历两个列表,将两段英文中都有的单词添加到新的列表中
for word in list1:
if word in list2:
common_words.append(word)
# 输出新的列表
print(common_words)