Assuming your string is s
:
'$' in s # found
'$' not in s # not found
# original answer given, but less Pythonic than the above...
s.find('$')==-1 # not found
s.find('$')!=-1 # found
And so on for other characters.
... or
pattern = re.compile(r'd$,')
if pattern.findall(s):
print('Found')
else
print('Not found')
... or
chars = set('0123456789$,')
if any((c in chars) for c in s):
print('Found')
else:
print('Not Found')
[Edit: added the '$' in s
answers]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…