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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!