Please help me !! I don't know what I did wrong, can someone explain to me, pls ?
"word" is just a text,
word is a temporary variable that holds actual (in the loop context) element of your array.
Let's say that I have this array:
x = ["1", "2", "3"]
Now when I want to print out every element of this array I can use your code:
x.each do |word| print "word" end
and it will result in:
because "word" is just a text.
After correcting the code:
x.each do |word| print word end
we get the correct output:
After this correction:
run your script and check how the output has changed.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.