Creating Methods Quiz


What happens when we add two strings together like in the following code?

"Hello" + "World"

Show Answer

Define a method, called hello_world, that prints out the string "Hello World!". Then, call the method to make it print.

Show Answer

Define a method, remove_as, that takes a string as input and returns an array of the letters in the string with every letter "a" (only lowercase) removed. Then, call the method on the string "artistic aardvarks are annoying". (Hint: use the string split, and array delete methods).

Show Answer