array = [["A",1], ["B",2], ["C", None], [None,None], [None,None], [None,None], [None,None]] header = 0 free = 3 def traverse(array): pointer = 1 while pointer != None: node = array[pointer] data = node[0] print(data) pointer = node[1] def append(newdata): global free newnode = array[free] newnode[0] = newdata pointer = header while pointer != None: node = array[pointer] pointer = node[1] node[1] = free free = free + 1 choice = '' while choice != 'X': print(' A | Traverse') print(' B | Append') choice = input('enter') if choice == 'A': traverse(array) if choice == 'B': data = input('enter a data value') append(data)