I am feeling very strange when I am working on list, dictionary and tuple in python.
When we declare multiple variable in one line like a = b = c = 0
it behaves like separate variables.
If we are update value any of the above variables then it will not affect another variable like below.
a = 10
b = 11
c = 13
But, this thing is not applying with list, tuple and dictionary. If we declare blank list like below.
a = b = c = []
Now, I am appending a value to only a
list.
a.append('Testing')
Now, b
and c
are automatically assigned that value.
This thing also happens with dictionary and tuple also.
I have to know that why it is not accept to declare it like above example.