What happens when we assign same values in two variables, is their address remains same?
2 Answers
Let’s see one example:
>>> a = 10
>>> b = a
>>> a
10
>>> b
10
>>> id(a)Â Â Â Â Â Â //To get address
1864841616
>>> id(b)
1864841616
The address is same because the value of both variables are same, that’s why python is called memory efficient.