Guest User

Untitled

a guest
May 22nd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. The “T” from “Turing”. "Turing"[0]
  2. The length of “Turing”. "Turing".length
  3. Make the whole string capital letters. "Turing".upcase
  4. Delete the “n” from “Turing”. "Turing".delete("n")
  5. Assign “Turing” to a variable. turing = "Turing"
  6.  
  7.  
  8. What does gets do? gets takes user input and returns it as a value to the program
  9. What is the difference between the input
  10. without the .chomp and the input with the
  11. .chomp? gets returns the user input with a newline, .chomp returns the input without the newline
  12. What does fav_num.to_i do? .to_i converts the value of fav_num to an integer
  13.  
  14.  
  15. What does animals.length return? returns the number of items are in the array
  16. What does animals[0] return? "dog", the first item in the array
  17. What does animals.empty? return? returns false, indicating there are items in the array
  18. What are two different ruby commands that
  19. add to the animals ? animals << "Skunk" : animals.push("skunk")
  20. What ruby command is used to remove the
  21. last element from the array? animals.pop
Add Comment
Please, Sign In to add comment