12.Loops and Iterators


Why does it say I am incorrect? Been trying at it for 3 months. It says:

Oops, try again. It looks like your iterator didn't print
 out double the value of each item of the odds array.
 Make sure to multiply each item by 2.

odds = [1, 2, 3, 4, 5]
odds.each do |odds|
odds *=2
print odds


odds.each do |x|
    if x % 2 != 0
        puts x * 2

Without a link to the exercise we have no way to check this against the instructions. Please post a link. Thank you.


Hi, I struggled on this for a while also.
You have to make sure you are printing 'x' and not 'odds'.
Hope this clears it up.


Thanks this helped :slight_smile: