Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```
- l1 = [[10,20,30], 1, 2, 3]# a list with another list at index 0
- l2 = list(l1) # create a copy
- l1.append(4) # append to list l1
- l1[0].append(40) # modify the inner list of l1
- print(l1)
- print(l2)
- ```
- **Output**
- *[[10, 20, 30, 40], 1, 2, 3, 4]*
- *[[10, 20, 30, 40], 1, 2, 3]*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement