-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalphand.py
60 lines (51 loc) · 1.52 KB
/
alphand.py
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
52
53
54
55
56
57
58
59
60
'''
In the first line, print True if s has any alphanumeric characters. Otherwise, print False.
In the second line, print True if s has any alphabetical characters. Otherwise, print False.
In the third line, print True if s has any digits. Otherwise, print False.
In the fourth line, print True if s has any lowercase characters. Otherwise, print False.
In the fifth line, print True if s has any uppercase characters. Otherwise, print False.
'''
if __name__ == '__main__':
s = input()
for i in range(len(s)):
if s[i].isalnum()==True:
a = True
else:
b = False
m=(a or b)
print(m)
for i in range(len(s)):
if s[i].isalpha()==True:
a = True
else:
b = False
m=(a or b)
print(m)
for i in range(len(s)):
if s[i].isdigit()==True:
a = True
else:
b = False
m=(a or b)
print(m)
for i in range(len(s)):
if s[i].islower()==True:
a = True
else:
b = False
m=(a or b)
print(m)
for i in range(len(s)):
if s[i].isupper()==True:
a = True
else:
b = False
m=(a or b)
print(m)
'''
A=print(True) if s.isalnum()== True else print(False)
B=print(True) if s.isalpha()== True else print(False)
C=print(True) if s.isdigit()== True else print(False)
D=print(True) if s.islower()== True else print(False)
E=print(True) if s.isupper()== True else print(False)
'''