Advertisement
rejohnson547

Lists 3/29/2015

Mar 29th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. ages = [11, 14, 18, 22, 24]
  2.  
  3. ages[2] = 27
  4.  
  5. print(ages)
  6.  
  7. ages[:3]
  8.  
  9. print(ages[:3])
  10.  
  11. print(ages[:])
  12.  
  13. ages.append(60)
  14.  
  15. print(ages)
  16.  
  17. ages[:2] = [80, 90]
  18.  
  19. print(ages)
  20.  
  21. ages[:] = 'test'
  22.  
  23. print(ages)
  24.  
  25. ages[:] = []
  26.  
  27. print(ages)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement