KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
When I ran this script (Python v2.6): a = [1,2] b = a a.append(3) print a >>>> [1,2,3] print b >>>> [1,2,3] I expected print b to output [1,2] . Why did b get changed when all I did was change a? Is b permanently tied to a? If so, can I make them independent? How?
Tags (comma-separated)
Save Edits
Cancel