I am defining a list and referring it to another variable. But when assigning variable to list in two different way and when printing variable then getting different values.
Anyone can explain why the result is different in both cases.
x=[1,2,3,4]
y=x
x+=[7]
print("Output 1 is :" ,x, y)
x=x+[6]
print("Output 1 is :" ,x, y)
Output 1 is : [1, 2, 3, 4, 7] [1, 2, 3, 4, 7]
Output 1 is : [1, 2, 3, 4, 7, 6] [1, 2, 3, 4, 7] ```