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!")
Source by kite.com #
 
PREVIOUS NEXT
Tagged: #check #element #list #python
ADD COMMENT
Topic
Name
4+9 =