Write a python function Password match the required criteria:


Topic: Write a python function Password match the required criteria:

Solution

def PasswordMatchCriteria(pas):
upper,lower,special,num = 0,0,0,0
for x in pas:
if (len(pas) >= 6) and (len(pas) <=12):
if x.isupper():
upper+=1
elif x.islower():
lower+=1
elif x.isnumeric():
num +=1
elif x.isspace():
j = 0
else:
special += 1
if (upper > 0) and (lower > 0) and (special > 0) and (num > 0):
return True
else:
False
passwords = input("Enter Passwords which are seperated by \",\": ")
password = passwords.split(",")
for i in password:
if PasswordMatchCriteria(i):
print(i)



List all Python Programs