#Ryan Bockmon #List function examples #1 #creates an empty lists people = [] def printList(): print("---------") print(people) printList() #adds a single item people.append("Ryan") printList() #adds multiple people to the list people.extend(("John","Kerri")) printList() #oh no, Shannon joined in! people.append("Shannon") printList() #lets remove her people.remove("Shannon") printList() #print first and last person print("---------") print("First person :",people[0]) print("Last person :",people[-1]) print("---------") #prints everything after the first item print(people[1:]) print("---------") #prints everything but the last item print(people[:-1]) #shorts list people.sort() printList() #reverses list people.reverse() printList()