Answers for "how to check if list contains value python"

18

python check if list contains

# To check if a certain element is contained in a list use 'in'
bikes = ['trek', 'redline', 'giant']
'trek' in bikes
# Output:
# True
Posted by: Guest on February-19-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 list contains value python"

Python Answers by Framework

Browse Popular Code Answers by Language