arrays extending list list can be appended to second list using the extend(method as shown in the following examplepylista pylistb pylista extendpylistb if the list being extended has the capacity to store all of the elements from the second listthe elements are simply copiedelement by element if there is not enough capacity for all of the elementsthe underlying array has to be expanded as was done with the append(method since python knows how big the array needs to be in order to store all of the elements from both listsit only requires single expansion of the destination listpylista the new array will be created larger than needed to allow more items to be added to the list without first requiring an immediate expansion of the array after the new array is createdelements from the destination list are copied to the new array followed by the elements from the source listpylistbas illustrated in figure pylistb pylista pylista figure the result of extending pylista with pylistb inserting items an item can be inserted anywhere within the list using the insert(method in the following example pylist insert we insert the value at index position since there is already an item at that positionwe must make room for the new item by shifting all of the items down one position starting with the item at index position after shifting the itemsthe value is then inserted at position as illustrated in figure if there are no free slots for the new itemthe list will be expanded in the same fashion as described earlier