First page Back Continue Last page Overview Graphics

Copying with [:] / Shallow Copy

Let's look at the following statements:

>>> lst1 = ['a','b',['ab','ba']]

>>> lst2 = lst1[:]

“a”

“b”

“ab”

“ba”

lst1

lst2