1 Resposta
+ 1
list.insert(i, x) inserts an item "x" at a given position "i" in the list.
list.extend(iterable) appends all the items from "iterable" to the list.
For example:
lst = [1, 2, 4]
lst.insert(2, 3) # inserts the number 3 at the index 2
print(lst) # [1, 2, 3, 4]
lst.extend([5, 6, 7])
print(lst) # [1, 2, 3, 4, 5, 6, 7]