while i > position:
array[i], array[i - 1] = array[i - 1], array[i]
import random
array = [random.randint(-100, 100) for _ in range(1, 10)]
print(array)
num = 345
position = 2
array.append(None)
i = len(array) - 1
while i > position:
array[i], array[i - 1] = array[i - 1], array[i]
i -= 1
array[position] = num
print(array)