You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each name in python is bound to an object, so in essence the second list contains three references to the same object. Since the object is the same, modification of any entry is reflected in all the others.
A variable name is just a binding to an object. When you assign to that name, you don't modify the object, you simply bind that variable to a new object, a new list. Meanwhile, the objects bound by the list remain unchanged.