-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdef_filter_2.py
49 lines (39 loc) · 939 Bytes
/
def_filter_2.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
def filter1(a):
import re
if bool(re.match(r'([A-Za-z])', a)) == True:
print("1. - True")
return True
else:
print("1. - False")
return False
def filter2(a):
import re
if bool(re.findall(r"([^A-Za-z0-9.-])", a)) == True:
print("2. - True")
return True
else:
print("2. - False")
return False
def filter3(a):
import re
if bool(re.findall(r"\w", a[-1])) == True:
print("3. - True")
return True
else:
print("3. - False")
return False
def filter4(a):
if len(min(a)) == 1:
print("4. - True")
return True
else:
print("4. - False")
return False
def filter5(a):
if len(a) == 20:
print("5. - True")
return True
else:
print("5. - False")
return False
print(all([filter1(), filter2(), filter3(), filter3(), filter4(), filter5()]))