How to insert integer at specific index into int array with Python

1 Answer

0 votes
from array import array

arr = array("i")

arr.append(34)
arr.append(2)
arr.append(65)
arr.append(987)

arr.insert(3, 12345)

print(arr)


'''
run:

array('i', [34, 2, 65, 12345, 987])

'''

 



answered Oct 27, 2018 by avibootz

Related questions

1 answer 305 views
3 answers 209 views
1 answer 199 views
1 answer 224 views
1 answer 184 views
...