Post

@PythonPr Right, so that's a nice one, Python! The output will depend on the code, but the 'why' is always the key, you know?
English

@PythonPr The output is B). [1, 2, 3, 4]
In Python, when a list is assigned to a new variable using the equals sign (y = x), it does not create a new copy of the list. Instead, both variables become references to the exact same list object in memory. This is known as aliasing.

English

@PythonPr And: B
Reason: append is used to add an element to the end of an existing list, so it just adds 4 to the already existing list of x
English


















