# This stores names in a list, with each name appearing only once.

def AddToList(L, name):
    # This first checks the list to see if the name already exists;
    # if the name is not found it is appended to the list.
    for person in L:
        if person == name:
            print "That person is already in the list."
            return
    else:
        L.append(name)

def BuildList(L):
    # This loops around asking for names and calls function AddToList to
    # insert them into the list.
    done = False
    while not done:
        name = raw_input( "Enter a name or blank to exit: " )
        if name == "":
            done = True
        else:
            AddToList(L, name )

def PrintList( L ):
    # This just prints the list.
    for person in L:
        print person

def main():
    namelist = []
    BuildList(namelist)
    PrintList(namelist)

main()
