List assignment index out of range

i usually get stuck in this kind of error while using lists

You are getting this error because you have made an empty list called list2 and you are trying to access various indexes in it . So try making list2 of the size you require by creating an empty list such as

list2=[0]*n1
This will create a list of size n1 and you will be able to access its indexes upto size n1.

thank you so much sir

sir this error occurs almost everytime list assignment out of range
how can i avoid it
i have come from cpp and this doesn’t happen there and i am used to it so please get me out of this

ok sir thank you i have understood thank you

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

sir test cases are not passing on hackerblocks merge sort question
question- https://hack.codingblocks.com/app/contests/781/544/problem
code- https://ide.codingblocks.com/s/194647