Answers for "how to check if element exists in a list in python"

9

Check if element in list Python

listA = [item1, item2, item3]
if item4 in listA:
  print('yes, item4 is in the list')
else:
  print('no, item4 is not in the list')
Posted by: Guest on November-21-2020
0

how to check if one value is in the list python

if ourlist.count('to') > 0:
   print('"to" exists in ourlist');
Posted by: Guest on December-29-2021

Code answers related to "how to check if element exists in a list in python"

Python Answers by Framework

Browse Popular Code Answers by Language