forked from sumanchaurasiya/python-problems
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path19.py
More file actions
32 lines (28 loc) · 723 Bytes
/
19.py
File metadata and controls
32 lines (28 loc) · 723 Bytes
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
# python prog to check validity of ka passwordValidation :
'''At least 1 letter between [a-z] and 1 letter between [A-Z].
At least 1 number between [0-9].
At least 1 character from [$#@].
Minimum length 6 characters.
Maximum length 16 characters.'''
import re
pw = input("Enter your password : ")
x = True
while x:
if(len(pw)<6 or len(pw)>16):
break
elif not re.search("[a-z]",pw):
break
elif not re.search("[A-Z]",pw):
break
elif not re.search("[0-9]",pw):
break
elif not re.search("[$#@]",pw):
break
elif re.search("\s",pw):
break
else:
print("Valid Password")
x = False
break
if x:
print("Not a Valid Password")