Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
keeperofdakeys
on Nov 7, 2011
|
parent
|
context
|
favorite
| on:
Python: copying a list the right way
c = [4,5,6] is creating a new list, and assigning it to c; not modifying the list that c pointed to. The '=' operator simply associates an object reference to a variable. Going d=c is copying the reference to an object from one variable to another.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: