Why does it say that the array isn't being multiplied?


#1

odds = [1,3,5,7,9]

odds.each do |x|
x = x*2
print "#{x} "
end


#2

Try this x *= 2, worked to me!


#3

It' not working for me. Neither of your suggestions helped


#4

You're missing The " "


#5

You have a space after your quotation mark after print "#{x}"


#6

It worked for me after I copied and pasted the code, and then took out the space in print "#{x} ".
Thanks! Unfortunately, however, I still have a very loose grasp on these iterators and Ruby in general. Any good tutors out there than are free? :smiley:


#7

it has to be "odd" not odds that is why it is giving you such error.Thanks