-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpractical3.py
More file actions
38 lines (26 loc) · 1.01 KB
/
practical3.py
File metadata and controls
38 lines (26 loc) · 1.01 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
def check(passwd):
val = True
if len(passwd) < 9:
print('length should be at least 9')
val = False
if not any(char.isdigit() for char in passwd):
print('Password should have at least one numeral')
val = False
if not any(char.isupper() for char in passwd):
print('Password should have at least one uppercase letter')
val = False
if not any(char.islower() for char in passwd):
print('Password should have at least one lowercase letter')
val = False
Specialchar =['', '%', '#', '$']
if not any(char in Specialchar for char in passwd):
print('Password should have at least one of the symbols _ Or % Or * Or $')
val = False
if val:
return val
print("Enter password ...")
passwd = input()
if (check(passwd)):
print("Password Accepted")
else:
print("Invalid Password !!")