How to check for any special characters ($, @, %,& etc...) are present on an string, tuple, list or dictionary... | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
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

31st Jan 2019, 7:14 PM
Vinod Damunupola
Vinod Damunupola - avatar
6 Respostas
+ 5
from string import punctuation s = 'mmn@' print(any(p in s for p in punctuation)) # True
31st Jan 2019, 7:30 PM
Anna
Anna - avatar
+ 4
Try this code to see which characters will be found: https://code.sololearn.com/cJy4Al9Qu0Hu/?ref=app
31st Jan 2019, 7:41 PM
Anna
Anna - avatar
+ 3
You're welcome ā˜ŗļø
31st Jan 2019, 7:42 PM
Anna
Anna - avatar
+ 2
Thanks a lot
31st Jan 2019, 7:41 PM
Vinod Damunupola
Vinod Damunupola - avatar
0
Is this method okay with all the asci characters except letters and numbers ?
31st Jan 2019, 7:39 PM
Vinod Damunupola
Vinod Damunupola - avatar
0
šŸ˜ŽšŸ˜ŽšŸ˜
31st Jan 2019, 7:44 PM
Vinod Damunupola
Vinod Damunupola - avatar