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 173 views
2 answers 232 views
2 answers 233 views
1 answer 132 views
1 answer 129 views
...