As everybody else said, when you write l2 = l1 you are not creating a new list, but pointing l2 to the same position in memory as l1.
If you want another list with the same elements then these are your choices of commands:
l2 = l1[:]
l2 = l1.copy()
import copy \n l2 = copy.copy(l1)
Moreover (and this is my "original" contribution to this discussion) obviously you can't do this with tuples, as they are not modifiable, and, in practise, if you have a tuple to modify, you first have to make it a list with the command - list1=list(tuple1) - (or you can create a new tuple based on the one before).
Things can get trickier if you have a list of tuples to convert, but you can use the following line of code to make it faster. So, for example:
list_of_tuples = [(1,2),(7,8),(‘Italy’,’France’)]
list_of_lists = [list(elements) for elements in list_of_tuples]
As straightforward as it may be from reading it, it means to transform each element in a list.
Same for going back:
list_of_lists=[[1,2],[7,8],[‘Italy’,’France’]]
list_of_tuples = [tuple(element) for element in list_of_lists]
Yes, I kind of got sidetracked, what I wanted to say is that this doesn't happen with tuples (their location is changed when you modify them to a list), as can be seen with:
tuple1 = (1,2,3,4,5,6)
tuple2 = tuple1
tuple1 = tuple(reversed(list(tuple1)))
print(tuple1, tuple2)
On PythonTutor.