Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update1 main.py #72

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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: 4 additions & 4 deletions Python-scripts/Password Validator/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def passwordValidator():
"""
# display rules that a password must conform to
print('\nYour password should: ')
print('\t- Have a minimum length of 6;')
print('\t- Have a minimum length of 8;')
print('\t- Have a maximum length of 12;')
print('\t- Contain at least an uppercase letter or a lowercase letter')
print('\t- Contain at least a number;')
Expand All @@ -17,9 +17,9 @@ def passwordValidator():
userPassword = input('\nEnter a valid password: ').strip()
# check if user's password conforms
# to the rules above
if not(6 <= len(userPassword) <= 12):
if not(8 <= len(userPassword) <= 12):
message = 'Invalid Password..your password should have a minimum '
message += 'length of 6 and a maximum length of 12'
message += 'length of 8 and a maximum length of 12'
return message
if ' ' in userPassword:
message = 'Invalid Password..your password shouldn\'t contain space(s)'
Expand All @@ -38,4 +38,4 @@ def passwordValidator():
return 'Valid Password!'

my_password = passwordValidator()
print(my_password)
print(my_password)