Page 6 - Lesson Note - LISTS
P. 6

List Functions


               append

               Adds a (one) new element at the end of an existing list
               Syntax:   list.append(element)


















               extend

               Adds a new LIST at the end of an existing list
               Syntax:   list1.extend(list2)



















               insert

               Inserts an element at a specified index, if index out of range it inserts element at the last for positive
               index and in the beginning for the negative index

               Syntax:     list.insert(index, element)
   1   2   3   4   5   6   7   8