a_string = "A string is more than its parts!" matches = ["more", "wholesome", "milk"] if any(x in a_string for x in matches):
如果是 判斷 多個字符串 全部在 a_string 里面 出現 就 把 any 換成 all (和c# 的 linq all any 很像)
判斷一個數組 是否 在 另一個數組里面 用 set() 來判斷
>>> A= [1,2,3,4] >>> B= [2,3] >>> set(B).issubset(set(A)) True