Right tool for the job let's me move on but doesn't put!



I keep getting this error message, now this example is for line 1 but it was also for line 2 in the past.

(ruby):1: syntax error, unexpected '}', expecting keyword_end

The exercise says I passed but in the end because of the error there's nothing that got puts on the screen :frowning:
I'd like to get to the end of this ^^.
Thanks for your help and feedback.

my_array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
my_array.each { if my_array.even? then puts my_array}


That's not a valid if-expression (have a look at a reference for the syntax, though the error message already says what the problem with the if-expression is)


Hi, sorry for my late reply. Alright thanks a lot for your help in solving this ! Much appreciated !


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.