-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path151220_JUIT_assignment_Application_developer.py
43 lines (29 loc) · 1.18 KB
/
151220_JUIT_assignment_Application_developer.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
''' Sunday 24-Feb-2019
Aayush Gupta
151220
jUIT'''
import re
def password_checker(password):
# Checking each condition
if len(password) < 6:
return 'Failure Password must be at least 6 characters long.'
if len(password) > 12:
return 'Failure Password must be at max 12 characters long.'
if re.search(r"[a-z]", password) is None:
return 'Failure Password must contain at least one letter from a-z.'
if re.search(r"\d", password) is None :
return 'Failure Password must contain at least one digit from 0-9.'
if re.search(r"[A-Z]", password) is None :
return 'Failure Password must contain at least one letter from A-Z.'
if re.search(r"[*$_#=@]", password) is None:
return 'Failure Password must contain at least one letter from *$_#=@.'
if re.search(r"[%!)(]", password) is not None:
return 'Failure Password cannot contain %!)(.'
if ' ' in password or '\t' in password:
return 'Failure Password must not contain whitespaces.'
return 'Success'
string = raw_input()
# Splitting and Stripping string to form list of passwords.
pass_list = [x.strip() for x in string.split(',')]
for each in pass_list:
print("%s %s" % (each, password_checker(each)))