adding accessing and deleting items from a python list
<p>Learning lists and arrays and I am not sure where I went wrong with this program. Keep in mind I am still new to python. Unsure if i am doing it right. Ive read a few tutorials and maybe Im not grasping list and arrays. Ive got it to where you can type a name but it doesnt transfer to a list and then i get list is empty constantly as well as other errors under other functions in the code.</p>

<pre><code> def display_menu():
    print("")
    print("1. Roster ")
    print("2. Add")
    print("3. Remove ")
    print("4. Edit ")
    print("9. Exit ")
    print("")
    return int(input("Selection&gt; "))


def printmembers():
        if namelist &gt; 0:
            print(namelist)
        else:
            print("List is empty")


def append(name):
    pass


def addmember():
    name = input("Type in a name to add: ")
    append(name)

def remove():
    pass

def removemember():
    m = input("Enter Member name to delete:")
    if m in namelist:
        remove(m)
    else:
        print(m, "was not found")

def index():
    pass

def editmember():
    old_name = input("What would you like to change?")
    if old_name in namelist:
        item_number = namelist.index(old_name)
        new_name = input("What is the new name? ")
        namelist[item_number] = new_name
    else:
        print(old_name, 'was not found')


print("Welcome to the Team Manager")

namelist = 0

menu_item = display_menu()

while menu_item != 9:
    if menu_item == 1:
        printmembers()
    elif menu_item == 2:
        addmember()
    elif menu_item == 3:
        removemember()
    elif menu_item == 4:
        editmember()
    menu_item = display_menu()
print("Exiting Program...")
</code></pre>

<p>After getting name from input, you call the append(name)  method, yet your append method doesn't do anything yet.</p>

<p>In your append method you have to add the name you get to your namelist, like how you do in the editmember method.</p>

python