KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
consider the following code: >>> x = y = [1, 2, 3, 4] >>> x += [4] >>> x [1, 2, 3, 4, 4] >>> y [1, 2, 3, 4, 4] and then consider this: >>> x = y = [1, 2, 3, 4] >>> x = x + [4] >>> x [1, 2, 3, 4, 4] >>> y [1, 2, 3, 4] Why is there a difference these two? (And yes, I tried searching for this).
Tags (comma-separated)
Save Edits
Cancel