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 162 views
2 answers 216 views
2 answers 220 views
1 answer 123 views
1 answer 118 views
...