Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Email List
#1
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.")
Reply


Messages In This Thread
Email List - by jackthechampion - Apr-07-2020, 02:53 AM
RE: Email List - by ndc85430 - Apr-07-2020, 05:37 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Extract email addresses from string and store them in a list oslosurfer 2 2,737 Nov-24-2019, 03:35 PM
Last Post: oslosurfer
  An email with inline jpg cannot be read by all email clients fpiraneo 4 4,035 Feb-25-2018, 07:17 PM
Last Post: fpiraneo
  Email - Send email using Windows Live Mail cyberzen 2 5,960 Apr-13-2017, 03:14 AM
Last Post: cyberzen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020