How to check if an element is contained in a list using Python

1 Answer

0 votes
lst = ["python", "c", "java", "c++", "php", "c#"]

if "java" in lst:
    print("yes")
else:
    print("no")


'''
run:

yes

'''

 



answered Dec 2, 2017 by avibootz
...