Forked from anonymous/gist:728208b1e2027f496384c82a36c85a70
Last active
May 10, 2017 17:19
-
-
Save ConnorMcF/9cec0ecc88bc27de87ae744aade81f38 to your computer and use it in GitHub Desktop.
ez pz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while True: | |
#number one and two | |
TryAgain = 'yes' | |
TryAgain == "yes" or TryAgain == "y" | |
#number three | |
NumDetected = False | |
UpperDetected = False | |
LowerDetected = False | |
SymbolDetected = False | |
print("====================================================") | |
#number 4 and 5 and 6 | |
NewPassword = input("Please enter you new password: ") | |
#this will now loop through the variable 'NewPassword' | |
for x in NewPassword: | |
#This is to find characters are present | |
if x == '0' or x == '1' or x == '2' or x == '3' or x == '4' or x == '5' or x == '6' or x == '7' or x == '8' or x == '9': | |
NumDetected = True | |
upper = x.isupper() | |
if upper == True: | |
UpperDetected = True | |
lower = x.islower() | |
if lower == True: | |
LowerDetected = True | |
if x == '$' or x == '£' or x == '#': | |
SymbolDetected = True | |
#This is the password strength loop | |
#Number 7 and number 8 | |
LengthOfPassword = len(NewPassword) | |
if LengthOfPassword >= 8 and UpperDetected == True and LowerDetected == True: | |
Detected = 'yes' | |
#This is for the password strength | |
if NumDetected == True and SymbolDetected == True: | |
StrengthOfPassword = 'Strong' | |
elif NumFound == True: | |
StrengthOfPassword = 'Medium' | |
else: | |
StrengthOfPassword = 'Weak' | |
#Number nine | |
else: | |
print("Please enter one uppercase letter, one lowercase letter and the length of the password you are making must be 8 characters or bigger") | |
#Number ten | |
print("Your new password is valid! The strength of your password is:", StrengthOfPassword) | |
#This is for the while loop if user doesnt want to try again | |
#Number eleven | |
TryAgain = input("Would you like to try again?? yes or y to try again, or no or n to stop: ") | |
TryAgain = TryAgain.lower() | |
if TryAgain == 'no': | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment