Question: Finish the following code, which fills the empty array statements with values, then prints it. 1. statements = [] 2 [kittens, puppies, piglets].each do |animal|
Finish the following code, which fills the empty array "statements" with values, then prints it.
1. statements = [] 2 ["kittens", "puppies", "piglets"].each do |animal| 3 statement = "I love " + animal 4 # add the statement to the statements array here. 5 ??? 6 end 7 puts statements?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
