As the topic title says, I think there's an inconsistency between what the question is asking and expected result for Exercise 18. Blocks.

Intructions say:

Add a block after .each that multiplies each item by itself and puts the result to the console.

Which means following code will solve this.

my_array.each {|x| puts x**x}

But instead, I get an error after executing saying the following:

Oops, try again. It looks like your block doesn't print the square of each number in my_array to the console using 'puts'."

Which means the following code below is the accepted answer to complete the exercise.

my_array.each {|x| puts x**2}

Edit: Realized my mistake...I guess I should take a break. Been "bootcamping" for 6 hours now.


If you multiply something you use : * single star.
If you do a power you use: **
You have written:

I think the instruction is correct. you used double star x**x instead x*x.

I think sometimes opening own eyes is better than telling others heads up.