Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions PASSWORD RELATED/password-validator/PASSWORD_VALIDATOR.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
3 changes: 2 additions & 1 deletion PASSWORD RELATED/password-validator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
Loading