I would like to know if this is normal behavior for Python. Code is:
>>>abcd = [["a","b","c","d"],[1,2,3,4]]
>>>testlist = []
then
>>>testlist.extend(abcd)
or if I use:
>>>for item in abcd:
testlist.append(item)
the result of calling testlist is the same, which is perfectly fine:
>>>testlist
[['a', 'b', 'c', 'd'], [1, 2, 3, 4]]
but then when I do something with 'testlist' the change appears also in 'abcd'
>>>testlist[0].append("anything")
>>>testlist
[['a', 'b', 'c', 'd', 'anything'], [1, 2, 3, 4]]
>>>abcd
[['a', 'b', 'c', 'd', 'anything'], [1, 2, 3, 4]]
It is making me crazy. How should I proceed without changing original list and not making copies of it every time I need to pull some data from it. Thank you.