Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The “T” from “Turing”. "Turing"[0]
- The length of “Turing”. "Turing".length
- Make the whole string capital letters. "Turing".upcase
- Delete the “n” from “Turing”. "Turing".delete("n")
- Assign “Turing” to a variable. turing = "Turing"
- What does gets do? gets takes user input and returns it as a value to the program
- What is the difference between the input
- without the .chomp and the input with the
- .chomp? gets returns the user input with a newline, .chomp returns the input without the newline
- What does fav_num.to_i do? .to_i converts the value of fav_num to an integer
- What does animals.length return? returns the number of items are in the array
- What does animals[0] return? "dog", the first item in the array
- What does animals.empty? return? returns false, indicating there are items in the array
- What are two different ruby commands that
- add to the animals ? animals << "Skunk" : animals.push("skunk")
- What ruby command is used to remove the
- last element from the array? animals.pop
Add Comment
Please, Sign In to add comment