I am given a list l and I want to do assignment:
l
l[index] = val
But there might be a case when the list is too small.
Try this:
def ResizeList(some_list, length, null_item = None): return some_list + [null_item for item in range(length - len(lst))]