Is there a way to insert a specific value into a List into a specific index. List should be completely empty:
L = []
L.insert(2,177)
print(L)
L should give out the values of L [ , ,117].
That is not possible. Lists cannot have "holes"; every slot in the list must contain a value.
You have two options:
Fill the list with dummy values:
L = [None] * 3
L[2] = 177
# L: [None, None, 177]
Use a dict rather than a list:
L = {}
L[2] = 177
# L: {2: 177}
A dict is a mapping between arbitrary values, so it can handle "holes" with no problem.