0
Pass by reference is it available in Python?
How can you change a parametr value in a function and pass that back?
1 Respuesta
+ 3
If you call a method of the object like so
def appendTo(arr, el):
arr.append(el) # Note here I called a method on the argument
the changes are made in the argument you passed itself. But if you directly modify it, a copy will be made.