How to check if a list of characters is in a string using Python

1 Answer

0 votes
s = 'python'

chars = set('yto')
if any((ch in chars) for ch in s):
    print('found')
else:
    print('not found')


'''
run:

found

'''

 



answered Nov 2, 2017 by avibootz
...