-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathz023.py
More file actions
executable file
·35 lines (31 loc) · 1.06 KB
/
z023.py
File metadata and controls
executable file
·35 lines (31 loc) · 1.06 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
#!/usr/bin/env python
def if_valid_password(str_pass):
# convert string of multiple passwords separated by coma to list
pass_list = str_pass.split(",")
print(pass_list)
for password in pass_list:
if len(password) < 6 or len(password) > 12:
print(password + "is too short or too long")
continue
count = 0
for c in password:
# if c not in small or capital or numbers or special:
if c in "qwertyuioplkjhgfdsazxcvbnm":
a = 1
elif c not in "qwertyuioplkjhgfdsazxcvbnm":
b = 1
elif c not in "0123456789":
c = 1
elif c not in "@#":
d = 1
else:
count += 1
print(count)
if count == len(password):
print(password + " is a valid password")
else:
print(password + " is NOT a valid password")
# p = input("Type password: ")
str_pass = "ABd1234@1,a F#,2w3E*,2We3345"
# print(if_valid_password(str_pass))
if_valid_password(str_pass)