I'm trying to write code that does this:
the_list = ['some list', 0, 1, 2]
def change(l):
x = ['some other list', 3, 4, 5]
l <- x
change(the_list)
print(the_list) # ['some other list', 3, 4, 5]
I.e. replacing the contents of list l
with the contents of x
.
What is the most pythonic way to do this?