Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to check if an element is in a list python

thelist = ["apple", "avocado", "banana"]

inpt = input("Check an item in the list: ")

if inpt in thelist:
  print(inpt, "is in the list!")
 
PREVIOUS NEXT
Tagged: #check #element #list #python
ADD COMMENT
Topic
Name
3+7 =