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

Related questions

1 answer 201 views
1 answer 224 views
1 answer 181 views
1 answer 263 views
1 answer 278 views
1 answer 206 views
...