diff --git a/PASSWORD RELATED/password-validator/PASSWORD_VALIDATOR.py b/PASSWORD RELATED/password-validator/PASSWORD_VALIDATOR.py index 76dfbef5..65d4d631 100644 --- a/PASSWORD RELATED/password-validator/PASSWORD_VALIDATOR.py +++ b/PASSWORD RELATED/password-validator/PASSWORD_VALIDATOR.py @@ -24,9 +24,13 @@ def passwordValidator(): if ' ' in userPassword: message = 'Invalid Password..your password shouldn\'t contain space(s)' return message - if not any(i in string.ascii_letters for i in userPassword): + if not any(i in string.ascii_uppercase for i in userPassword): message = 'Invalid Password..your password should contain at least ' - message += 'an uppercase letter and a lowercase letter' + message += 'an uppercase letter' + return message + if not any(i in string.ascii_lowercase for i in userPassword): + message = 'Invalid Password..your password should contain at least ' + message += 'a lowercase letter' return message if not any(i in string.digits for i in userPassword): message = 'Invalid Password..your password should contain at least a number' diff --git a/PASSWORD RELATED/password-validator/README.md b/PASSWORD RELATED/password-validator/README.md index 8ce2d6f7..feb673c5 100644 --- a/PASSWORD RELATED/password-validator/README.md +++ b/PASSWORD RELATED/password-validator/README.md @@ -3,7 +3,8 @@ This program validates passwords to match specific rules. A valid password is one that conforms to the following rules: - Minimum length is 6; - Maximum length is 12; -- Contains at least an uppercase letter or a lowercase letter +- Contains at least an uppercase letter +- contains at least a lowercase letter - Contains at least a number; - Contains at least a special character (such as @,+,£,$,%,*^,etc); - Doesn't contain space(s).