I started recently Python Language and i have a problem about lists. I was surprised not to find what i was looking for by searching on Google, I guess i couldn't explain with the right words because english isn't my native language. Here's my problem:
When i create a list and i want to modify it but i want to keep the last value, I don't know how to do. I thought that i could save my list in a second list, but when i modify the other list, it doesn't stay constant.
list1=[1,2,3,4]
list2=list1
list1.append(5)
print(list2)
For exemple, here, I thought that my list2 will stay constant but no, it is synchronised to the list1 and when I print(list2), the 5 that i added in list1 appears.
I really don't know how to solve this problem, if someone could help me it would be very cool, thanks !