Python Forum

Full Version: Email List
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
can someone fix this for me so it can only input emails having trouble






 scores = []

choice = None
while choice != "0":

    print(
    """
    Email List
    
    0 - Exit
    1 - Show Email List
    2 - Add an Email
    3 - Remove an Email
    4 - Sort Emails
    """
    )
    
    choice = input("Choice: ")
    print()

    # exit
    if choice == "0":
        print("Good-bye.")

    # list Email table
    elif choice == "1":
         print("Email List")
         for email in emails:
            print(email)

    # add a Email
    elif choice == "2":
        email = int(input("Add an Email: "))
        email.append(score)

    # remove a Email
    elif choice == "3":
        email = int(input("Remove which email?: "))
        if email in emails:
            emails.remove(email)
        else:
            print(score, "isn't in the Email List.")

    # sort Emails
    elif choice == "4":
        emails.sort(reverse=True)

    # some unknown choice
    else:
        print("Sorry, but", choice, "isn't a valid choice.")
  
input("\n\nPress the enter key to exit.")
What's wrong with your code and what have you tried to fix it?