According to my understanding, both functions should have changed list
since lists are mutable but only foo() did so.
def foo(myList):
myList[0] = 3
def bar(myList):
myList = [3,2,1]
list = [1,2,3]
print(list)
foo(list)
print(list)
bar(list)
print(list)