2 ms·
Memory locations? In Python? I don't even know what you're saying.
by icebraining 13y ago
Memory locations? In Python? I don't even know what you're saying.
- cgag 13y agoa = [1,2,3] b = a b += [1] => a == [1,2,3,1] a and b point to the same piece of memory even if you don't have to explicitly deal with pointers, you need to reason about them
- icebraining 13y agoYou just have to explain that "b = a" means that you're adding a new name to the thing/object named "a". Whether it's in the same memory location or not is an irrelevant implementation detail.