I'm a bit confused why in the second case x is not [1,2,3]: x = []
def y(): x.append(1) def z(): x = [1,2,3] y() print(x) z() print(x) Output: [1] [1] -- https://mail.python.org/mailman/listinfo/python-list
I'm a bit confused why in the second case x is not [1,2,3]: x = []
def y(): x.append(1) def z(): x = [1,2,3] y() print(x) z() print(x) Output: [1] [1] -- https://mail.python.org/mailman/listinfo/python-list