Created
May 10, 2017 17:12
-
-
Save anonymous/728208b1e2027f496384c82a36c85a70 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
#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 | |
y = 1 | |
while y == 1: | |
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 != 'yes' and TryAgain != 'y' and TryAgain != 'no' and TryAgain != 'n': | |
print("Please enter either yes or no") | |
else: | |
y = 0 | |
break |
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
#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 | |
y = 1 | |
while y == 1: | |
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 != 'yes' and TryAgain != 'y' and TryAgain != 'no' and TryAgain != 'n': | |
print("Please enter either yes or no") | |
else: | |
y = 0 | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment