Adds an item at a specified index in the list.
Syntax
list.insert(index, item)
The .insert()
method takes in two parameters:
- The index that you want to insert into.
- The item that you want to insert at the specified index.
Example
To add an item at index 2 of store_line
list:
Code Output