daily pastebin goal
74%
SHARE
TWEET

Untitled

a guest Oct 15th, 2018 62 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1. (setv lst [1 2 3])
  2. (setv (nth lst 1) 20)
  3.  
  4. lst=[1, 2, 3]
  5. lst[1]=20
  6.    
  7. (assoc lst 1 20)
  8.    
  9. $ hy --spy  # Shows Python translation.
  10. [...]
  11. => (setv lst [1 2 3])
  12. lst = [1, 2, 3]
  13. None
  14.  
  15. => (setv (. lst[1]) 20)
  16. lst[1] = 20
  17. None
  18.  
  19. => lst
  20. lst
  21.  
  22. [1, 20, 3]
  23. => (setv (get lst 2) 30)
  24. lst[2] = 30
  25. None
  26.  
  27. => lst
  28. lst
  29.  
  30. [1, 20, 30]
  31.    
  32. => (.__setitem__ lst 0 10)
  33. lst.__setitem__(0, 10)
  34.  
  35. => lst
  36. lst
  37.  
  38. [10, 20, 30]
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