When we write the following code:
a = [1,2]
b = a
a.append(3)
print(b)
Here, list becomes [1, 2, 3] for both a and b. But when I perform the code:
a=3
b=a
b+=1
Same thing doesn't happen here a=3 and b=4. So, can someone explain to me the reason for this. Also, which data type act as list and which as integer for the same.