Why in the first code the function update created a local variable with the same name (integ) without affecting the global integ while in the second code it changed the global value of list and didn't create a local list with the same name?
integ = 5
def update(integ):
integ += 2
update(integ)
print(integ)
list = [1,10]
def update2(list):
list += [2]
update2(list)
print(list)