检查列表项是否存在

  1. thislist = ["apple", "banana", "cherry"]
  2. if "apple" in thislist:
  3. print("Yes, 'apple' is in the fruits list")