0 votes
in Python Flask by
How do you insert an object at a given index in Python?

1 Answer

0 votes
by
Let’s build a list first.

>>> a=[1,2,4]
Now, we use the method insert. The first argument is the index at which to insert, the second is the value to insert.

>>> a.insert(2,3)
>>> a
[1, 2, 3, 4]

Related questions

0 votes
asked May 9, 2023 in Python Flask by Robin
0 votes
asked Jun 23, 2020 in Agile by anonymous
...