Yes, there is an important distinction between re-assigning a variable (which causes it to point to a different object), and modifying the object that a variable refers to.
Since lists are mutable, it's possible to modify the list object. e.g.
myList[0] = "new item"
If myList was a parameter in a function, then whatever list was passed in for myList will also be modified, because myList is referring to that same object, and we are modifying that object.
However, if you do:
myList = ["whole", "new", "list"]
then you are NOT modifying the original list object, you are just changing myList to point to a new list object that you created. Re-assigning the variable (or parameter) myList in one function will NOT affect the value of the list object that was passed in.
I realize this is a rather subtle distinction, but it is an important one, about how Python variables and assignment statements really work.
If we ignore functions and parameters for a moment, we can see the same issue comes up just using assignment statements:
x = [1, 2, 3]
y = x
y[0] = 100 #changes the first element of the list that both x and y refer to
print(f"x={x} y={y}")
y = [4,5,6] #changes y to point to a new/different list object
# but does NOT change the list that x refers to (and y used to refer to)
print(f"x={x} y={y}")
Now, since actual parameters are passed to functions "by assignment", the similar issue happens here:
def changeItem(y):
y[0] = 100
def tryToChangeWholeList(y):
y = [4,5,6]
def main():
x = [1,2,3]
changeItem(x)
print(x)
tryToChangeWholeList(x)
print(x)