Python list operation extend and append difference demonstration code

From , 3 Years ago, written in Python, viewed 53 times.
URL https://pastebin.vip/view/fa3dade3
  1. li = ['a', 'b', 'c']
  2. li.extend(['d', 'e', 'f'])                        
  3. print li
  4.  
  5. print len(li)                                            
  6.  
  7. print li[-1]
  8.  
  9. li = ['a', 'b', 'c']
  10. li.append(['d', 'e', 'f'])                        
  11.  
  12. print li
  13.  
  14. print len(li)                                            
  15.  
  16. print li[-1]
  17.  
  18. #//python/4499

Reply to "Python list operation extend and append difference demonstration code"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website