We can do this with the help of the insert() function in Python like:l=[1,2,3,4]l.insert(2,18)print(l)output:[1,2,18,3,4]
like:
l=[1,2,3,4]
l.insert(2,18)
print(l)
output:
[1,2,18,3,4]