I have to make a function that takes an empty list as first argument and n as secound argument, so that:
L=[] function(L,5) print L returns: [1,2,3,4,5]
In
def fillList(listToFill,n): listToFill=range(1,n+1)
you change only the pointer of listToFill, if you don't return the new pointer; the new pointer isn't available out of the function and you have still the pointer of your empty list (in outer scope).