I have encountered a strange behaviour of python
Case-1:-
         arr=[[0]*2]*3 and
         arr[0][0]=12
gives arr as [[12, 0], [12, 0], [12, 0]]
Case-2:-
         arr=[[0, 0], [0, 0], [0, 0]] and
         arr[0][0]=12
gives arr as [[12, 0], [0, 0], [0, 0]]
Why this type of behaviour?
 
    