Post

@PythonPr [1,2] is the output since the copy() method caused b to be bound to a new object in memory. The append() did nothing to a.
English

@PythonPr a = [1, 2 ]
It's a shallow copy.
Both a and b are pointing to different reference.
English

@PythonPr [1,2]
Shallow Copy:The command b = a.copy() creates a new list object b that contains the same elements as a.
Since b is a separate copy, any modifications made to b (like b.append(3)) do not affect the original list a.
When you print(a), it remains unchanged.
English













