We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Strings
- String Validators
- Discussions
String Validators
String Validators
Sort by
recency
|
1848 Discussions
|
Please Login in order to post a comment
Here is my completely overengineered Solution for you:
import re
if name == 'main': s = input() m = re.search(r'(?=(.\w)?)(?=(.[A-Za-z])?)(?=(.\d)?)(?=(.[a-z])?)(?=(.*[A-Z])?)', s) print('\n'.join([str(bool(group)) for group in m.groups()]))
if name == 'main': s = input() print(any(c.isalnum() for c in s)) print(any(c.isalpha() for c in s)) print(any(c.isdigit() for c in s)) print(any(c.islower() for c in s)) print(any(c.isupper() for c in s))