I have a simple code here and I am unsure as to what it is doing, please care to explain. :)
data = [5,6,7,8]
useList = data
useList.pop()
print(useList)
print(data)
For some reason the output is:
[5, 6, 7]
[5, 6, 7]
I do not understand why this occurs because I do not get rid of the 'data' value, I am only wanting to get rid of the useList value.
Is there a way to fix this?
Best Regards and any help will be openly accepted. :)