+ 7
You might be looking for re.match(), which returns an object that you can test for truthiness. import re n = "?!hello@#" print('yes' if re.match('[@#*:!?~]', n) else 'no')
14th May 2020, 9:45 AM
Hatsy Rei
Hatsy Rei - avatar