I want to create a validator for the correctness of the entered password, which should contain an uppercase letter, a lowercase letter, a number and a special character. I wanted to do this through a regular expression, but I have trouble creating the correct pattern. Can you help and point out what’s wrong with this code?
print (‘Create a password, which include: uppercase, lowercase, digits and special characters.’)
password = input()
pattern = re.compile (r’ [a-z] & [A-Z] & [0-9] & [!@#$%^&*]’)
validation = pattern.search(password)
print (‘Your password is corect’)
print(‘Your password is uncorect’)