• Coding Tip: Replacing a list without loosing link

 
my_list = [1,2,3]

def replace_list(ll):
    ll[:] = [4,5,6]

replace_list(my_list)
print(my_list)