int_list = [1,2,3,4]
mix_list = ["AB",7235,"C"]
def using_append(list1, list2):
list1.append(list2)
print(list1) # [1,2,3,4,["AB,7235,"C"]]
using_append(int_list, mix_list)
print(int_list) # [1,2,3,4,["AB,7235,"C"]] #why did int_list update?
As seen in the program, within the function using_append, there was no return used. That said, when i do a print(int_list), shouldn't I expect to get [1,2,3,4]
rather than [1,2,3,4,["AB,7235,"C"]]
? How does this work?