How to check if a character exists in list with Python

1 Answer

0 votes
ch = 'z'

if ch in ['python', 'c', 'c++', 'java']:
    print("yes")
else:
    print("no")




'''
run:

no

'''

 



answered Feb 2, 2022 by avibootz

Related questions

1 answer 174 views
2 answers 236 views
2 answers 234 views
1 answer 132 views
1 answer 129 views
...