Demo entry 6662813



Submitted by anonymous on Nov 27, 2017 at 19:12
Language: Python 3. Code size: 1.3 kB.

#menu() is the main function of the program. The user has the choice of what to do here. Also, the user always has the choice to return to this menu is necessary.

def menu():
    choice = input("Welcome to the Password Checker and Generator. \n Do you want to \n 1) Check password. \n 2) Generate Password \n 3) Quit.")

    if choice == '1' : #if the user chooses to check password, the check() function is called. This checks the password.

    elif choice == '2' :  #if the user chooses to generate password, the generate() function is called. This generates a password.

    elif choice == '3' : #if the user chooses to quit, the quitfun() function is called. This allows the user to quit the program.

    else :
        print ("Please choose either 1,2 or 3.")

        choice2 = input("Do you want to \n 1) Choose again \n 2) Exit") #this gives the user another go if they don't choose either 1, 2 or 3.
        if choice2 == '1':


        elif choice2 == '2':  #this gives the user the choice to quit.
            print("Thank you for using the Password Checker and Generator.")

        else :
            print ("Please choose either 1 or 2.")


This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).