Course
Simulator
More
Premium
Log in
Python Function Reference
Functions
insert
insert
Insert an item at a given position.
Python 3.13
list
.
insert
(
i
,
x
)
i
The index to insert at.
x
The item to insert.
Examples
Python 3.13
>>
>
a
=
[
1
,
3
]
>>
>
a
.
insert
(
1
,
2
)
[
1
,
2
,
3
]