There are some things which i want to explain when you need to define list length and when you don't.
First, you don't need to define list length at the beginning in
general case:
You can simply do :
#Just for example
new_list=[]
for i in map(chr,range(97,101)):
new_list.append(i)
print(new_list)
output:
['a', 'b', 'c', 'd']
Yes you need to define a empty list when you have another list for
index items like this:
matching_words=[None]*10
index_list=[4,3,1,2]
for i in zip(list(map(chr,range(97,101))),index_list):
matching_words.insert(i[1],i[0])
print(matching_words)
output:
[None, 'c', 'd', None, None, 'b', None, 'a', None, None, None, None, None, None]
['c', 'd', 'b', 'a']
In this program we have to insert chracter in that order in which the index_list showing the intergers , so if we try without defining list before then as you can see we are inserting first chr at index 4 which is not there.
In your case if you have second situation then try this to remove rest of none:
print([i for i in matching_words if i!='none'])
otherwise if you should go with first case.