- Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathstring-validators.py
More file actions
Latest commit
23 lines (17 loc) · 633 Bytes
/
Copy pathstring-validators.py
File metadata and controls
23 lines (17 loc) · 633 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Python > Strings > String Validators
# Identify the presence of alphanumeric characters, alphabetical characters, digits, lowercase and uppercase characters in a string.
#
# https://www.hackerrank.com/challenges/string-validators/problem
#
if__name__=='__main__':
s=input()
# any alphanumeric characters
print(any(c.isalnum() forcins))
# any alphabetical characters
print(any(c.isalpha() forcins))
# any digits
print(any(c.isdigit() forcins))
# any lowercase characters
print(any(c.islower() forcins))
# any uppercase characters
print(any(c.isupper() forcins))