比较Python中的if语句

from pip._vendor.distlib.compat import raw_input

Inventory1 = ["Rice", "Maze", "Oil", "Toothpaste", "Beans", "Cloth", "Pepper"]
print("Here are present items list information:", Inventory1)

CheckInv1 = input('Is this item present in the inventory: \n')

for CheckInv1 in Inventory1:
    if CheckInv1 == ("Rice", "Maze", "Oil", "Toothpaste", "Beans", "Cloth", "Pepper"):
        print("This item is present in the inventory list.")
        break
    else:
        print("User entered item is not present in the list.")
        break

问题:即使在代码输入中输入“油”文本,其仍然显示其他打印语句。 如果不比较语句。有什么建议么。谢谢

评论