+ 5
insert() is an inbuilt function in Python that inserts a given element like numbers at a given index in a list. Example: number = [1, 2, 3, 4] number.insert(2, 6) print(number)
1st Jan 2021, 1:29 AM
Dino Wun (Use the search bar plz!)
Dino Wun (Use the search bar plz!) - avatar
+ 5
Just an additional to Dino Wun (Use the search bar plz!) said. The output will become >> [1, 2, 6, 3, 4] The first parameter is the index and the second parameter is the element list.insert(index, element) The element which is in that same index of the original list will not be replaced but rather will be moved to the right.
1st Jan 2021, 1:41 AM
noteve
noteve - avatar
+ 3
Please avoid writing the question in the tags ☝
1st Jan 2021, 4:27 AM
Ipang