I'm struggling to get my password checker to recognize my special characters as true when they are inputted, any help would be appreciated!
import re
def password_cri():
while True:
password = input("Please enter your password:")
if len(password)<5 and len(password)>15:
print("Password denied: must be between 5 and 15 characters long.")
elif re.search('[0-9]',password) is None:
print("Password denied: must contain a number between 0 and 9")
elif re.search('[A-Z]',password) is None:
print("Password denied: must contain a capital letter.")
elif re.search('[a-z]',password) is None:
print("Password denied: must contain a lowercase letter.")
elif re.search('[!, @, #, $, %, &, (, ), -, _, [, ], {, }, ;, :, ", ., /, <, >, ?]', password) is None:
print("Password denied: must contain a special character")
else:
print("Your password has been accepted.")
break
password_cri()