0
Q:

how to check an element in a list in python

thislist = ["apple", "banana", "cherry"]
if "apple" in thislist:
  print("Yes, 'apple' is in the fruits list")
8
# app.py

listA = ['Stranger Things', 'S Education', 'Game of Thrones']

if 'Dark' in listA:
    print("Yes, 'S Eductation' found in List : ", listA)
else:
    print("Nope, 'Dark' not found in the list")
1
listA = [item1, item2, item3]
if item4 in listA:
  print('yes, item4 is in the list')
else:
  print('no, item4 is not in the list')
0

New to Communities?

Join the community