SHARE
TWEET

Untitled

a guest May 20th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. items = [12, 2, 'str', [], {}]
  2. print(items)
  3. for i in range(0, len(items)):
  4.     print(items[i])
  5.  
  6. print(items[1:3])
  7.  
  8. print(items * 3)
  9.  
  10. print(items + items)
  11.  
  12. print(12 in items)
  13.  
  14. items.append(4)
  15.  
  16. print(items)
  17.  
  18. items.extend(items)
  19.  
  20. print(items)
  21.  
  22. print(items.index(12))
  23.  
  24. print(items.count(12))
  25.  
  26. items.reverse()
  27. print(items)
  28. items.reverse()
  29.  
  30. nums = [1, 2, 3, 4, 5, 6, 11, 10]
  31. nums.sort()
  32. print(nums)
  33.  
  34. x = nums.copy()
  35. print(x)
  36.  
  37. x.clear()
  38. print(x)
  39.  
  40. for z in items:
  41.     print(z)
  42.  
  43. items.pop(0)
  44.  
  45. L = [x**2 for x in range(5)]
  46. print(L)
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