def main(): currPassword = Password() currPassword.setPassword() done = True while done: print("\nCheck another password?") print("(1): Yes") print("(2): No") userChoice = int(input("Enter choice: ")) if userChoice == 1: currPassword.setPassword() elif userChoice == 2: break else: print("Enter a valid choice.")
def main(): again = True while again: password = Password() password.setPassword( input( "Enter a password (minimum of eight characters and needs two numbers): " )) if password.isValid(): print("Valid Password.") else: print(password.getErrorMessage()) playAgain = input("Do you want to play again?(Y/N): ").upper() if playAgain == "Y": pass else: again = False print("Thanks for playing!")
def main(): # Tell the user what the password parameters are print("Password must be 8 characters long") print("Password must contain at least one letter and at least two numbers") print("Password cannot have any special characters") # Create a loop until the user enters a password that satisfies the parameters loop = True while loop: # ask the user for the desired password userPassword = input("Enter the desired password: "******"": loop = False print("Password meets parameters")
from password import Password password1 = Password() # get user input password1.setPassword(input("Enter password: ")) password1.main()
from password import Password userInput = '' userPassword = Password() while userInput != ":q!": userInput = input("Enter Password\n") userPassword.setPassword(userInput) userPassword.calculateScore() #userPassword.printReport() userPassword.printScore()