From e284dd350324fc262227182c4dd3920e2adb6f52 Mon Sep 17 00:00:00 2001 From: Ayush7-alt <115390881+Ayush7-alt@users.noreply.github.com> Date: Tue, 11 Oct 2022 23:29:55 +0530 Subject: [PATCH] Update main.py The length was small so I exceed password length for more security --- Python-scripts/Password Validator/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Python-scripts/Password Validator/main.py b/Python-scripts/Password Validator/main.py index 8d1bf07..685cf6b 100644 --- a/Python-scripts/Password Validator/main.py +++ b/Python-scripts/Password Validator/main.py @@ -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;') @@ -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)' @@ -38,4 +38,4 @@ def passwordValidator(): return 'Valid Password!' my_password = passwordValidator() -print(my_password) \ No newline at end of file +print(my_password)