1thislist = ["apple", "banana", "cherry"]
2if "apple" in thislist:
3 print("Yes, 'apple' is in the fruits list")
1# checking all elements of list_B in list_A
2list_A = [1, 2, 3, 4]
3list_B = [2, 3]
4
5check = any(item in list_A for item in list_B)
6
7print(check)
8# True
1thelist = ["apple", "avocado", "banana"]
2
3inpt = input("Check an item in the list: ")
4
5if inpt in thelist:
6 print(inpt, "is in the list!")
1# app.py
2
3listA = ['Stranger Things', 'S Education', 'Game of Thrones']
4
5if 'Dark' in listA:
6 print("Yes, 'S Eductation' found in List : ", listA)
7else:
8 print("Nope, 'Dark' not found in the list")
9