Guest User

Untitled

a guest
Nov 18th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. The “T” from “Turing”. [0]
  2. The length of “Turing”.length
  3. Make the whole string capital letters.upcase
  4. Delete the “n” from “Turing”.delete("n")
  5. Assign “Turing” to a variable. school = Turing
  6.  
  7. What does gets do? gets allows the user to input data
  8. What is the difference between the input without the .chomp and the input with the .chomp? Without chop you are actaully adding a new line with gets.chomp it removes the line from any new text.
  9. What does fav_num.to_i do? converts the number to an integer.
  10.  
  11. What does animals.length return? 4 the length of the array
  12. What does animals[0] return? dog it is the position of the element
  13. What does animals.empty? return? false bc the array isn't empty.
  14. What are two different ruby commands that add to the animals ? push, (+), (<<)
  15. What ruby command is used to remove the last element from the array? pop
Add Comment
Please, Sign In to add comment