Demo entry 2837969

Task 1

   

Submitted by anonymous on Oct 08, 2015 at 15:50
Language: Python 3. Code size: 972 Bytes.

#This is the start of a while loop that functions when true 
while True:
#When it is true, the main menu will be printed
    print(
    '''Please Choose what you wish to do from the following options
    0 - Encrypt
    1 - Advanced Encrypt
    2 - Decrypt
    3 - Exit

    ''')
#The option selected will be the input of teh user, this will be any option from
#the main menu
    optionSelected = raw_input("Option: ")
#If option 0 is selected, it will tell the user then the while loop will break
    if optionSelected == "0":
        print("You have chosen to encrypt")
        break
    elif optionSelected == "1":
        print("You have chosen to do an Advanced Encrypt")
        break
    elif optionSelected == "2":
        print("You have chosen the Decrypt option")
        break
    elif optionSelected == "3":
        print("You have selected the Exit Option")
        sys.exit
    else:
        print ("invalid option selected")

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).