0
How to check for any special characters ($, @, %,& etc...) are present on an string, tuple, list or dictionary...
How to check for any special characters ($, @, %,& etc...) are present on an string, tuple, list or dictionary like checking for numbers using "isnumeric()" * Im on python 3
6 Antworten
+ 5
from string import punctuation
s = 'mmn@'
print(any(p in s for p in punctuation)) # True
+ 4
Try this code to see which characters will be found:
https://code.sololearn.com/cJy4Al9Qu0Hu/?ref=app
+ 3
You're welcome ☺️
+ 2
Thanks a lot
0
Is this method okay with all the asci characters except letters and numbers ?
0
😎😎😁