-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathString_validators.py
More file actions
51 lines (44 loc) · 1.06 KB
/
String_validators.py
File metadata and controls
51 lines (44 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
def fun1(s):
for i in range(len(s)):
if(s[i].isalnum()):
return True;
break;
return False;
def fun2(s):
for i in range(len(s)):
if(s[i].isalpha()):
return True;
break;
return False;
def fun3(s):
for i in range(len(s)):
if(s[i].isdigit()):
return True;
break;
return False;
def fun4(s):
for i in range(len(s)):
if(s[i].islower()):
return True;
break;
return False;
def fun5(s):
for i in range(len(s)):
if(s[i].isupper()):
return True;
break;
return False;
# String Validators in Python - HackerRank Solution END
if __name__ == '__main__':
s = raw_input()
# String Validators in Python - HackerRank Solution START
flagalphanum = fun1(s)
alphabetical = fun2(s)
digits = fun3(s)
lowercase = fun4(s)
uppercase = fun5(s)
print(flagalphanum)
print(alphabetical)
print(digits)
print(lowercase)
print(uppercase)