String = "Alienshave just discovered a way to open cans"
Arr=["Aliens","bird","cactus","John Cena"]
if any(words in String for words in arr):
print String
这段脚本用于显示 外星人刚刚发现了一种打开罐头的方法
但是我不希望它打印
字符串
,因为字符串
中的单词Alienshave
与Arr
中找到的Aliens
单词并不完全相同。
如何让比较的基础是数组中的字符串,并且不像通配符那样作用。