SHARE
TWEET

Untitled

a guest May 21st, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ```
  2. l1 = [[10,20,30], 1, 2, 3]# a list with another list at index 0
  3. l2 = list(l1)             # create a copy
  4.  
  5. l1.append(4)              # append to list l1
  6. l1[0].append(40)          # modify the inner list of l1
  7.  
  8. print(l1)
  9. print(l2)
  10. ```
  11.  
  12. **Output**  
  13. *[[10, 20, 30, 40], 1, 2, 3, 4]*  
  14. *[[10, 20, 30, 40], 1, 2, 3]*
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top