Guest User

Untitled

a guest
Dec 13th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. >> lower = "`" # predecessor of 'a'
  2. => "`"
  3. >> letters = []
  4. => []
  5. >> 10.times { letters << lower.succ! }
  6. => 10
  7. >> letters
  8. => ["j", "j", "j", "j", "j", "j", "j", "j", "j", "j"]
  9.  
  10.  
  11. # But
  12.  
  13. >> letters.clear
  14. => []
  15. >> lower = "a"
  16. => "a"
  17. >> 10.times { letters << lower; lower = lower.succ }
  18. => 10
  19. >> letters
  20. => ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]
Add Comment
Please, Sign In to add comment