Python does not have "output parameters", hence a plain assignment will only change the binding of the local variable, but will not modify any value, nor change bindings of variables outside the function.
However lists are mutable, so if you want to modify the argument just do so:
nameArray[:] = [0,1,2]
This will replace the contents of nameArray with 0,1,2 (works if nameArray is a list).
An alternative is to have your function simply return the value you want to assign:
def array_creator():
values = [0, 1, 2]
return values
my_arr = array_creator()
Finally, if the function wants to modify a global/nonlocal variable you have to declare it as such:
a = [1,2,3]
def array_creator():
global a
a = [0,1,2]
print(a) # [1,2,3]
array_creator()
print(a) # [0,1,2]
Or:
def wrapper():
a = [1,2,3]
def array_creator():
nonlocal a
a = [0,1,2]
return a, array_creator
a, creator = wrapper()
print(a) # [1,2,3]
creator()
print(a) # [0,1,2]
Note however that it is generally bad practice to use global variables in this way, so try to avoid it.
a = [0, 1, 2]? Why confuse people by assigning to the global scope from inside a function?