I apologize for the naive nature of the question. Consider the python code below and its output on the right:
I was under the impression that the output should be:
[2,3,10,5,8]
[2,3,4,5,8]
I thought that modifying the variable y will not modify x. Apparently, this is not true. How can I write code that allows me to modify y without modifying x.Thank you
Surprisingly, I don't get this behaviour when the data type is numbers. See the python code below: