如何確定一個字符串是否在每個列表中?例如:如果每個列表中的項目?
listEven = ["0", "2", "4", "6", "8"]
listOdd = ["1", "3", "5", "7", "9"]
listPrimes = ["2", "3", "5", "7"]
listOfLists = ["listOdd", "listPrimes"]
if "9" in each(listOfLists):
print("Math is broken")
else:
print("Good, 9 is still not prime")
基本上,是否有一個函數檢查列表中的每個列表中是否有東西?
來吧,先學習一些python基礎知識。 – Christian
listOfLists是兩個字符串的列表 – yuvi