def replace(items): # rebinding the local name breaks the link to the caller items = [9, 9, 9] return items nums = [1, 2, 3] result = replace(nums) print(nums) print(result)
reassigning a name inside does not reach the caller