My Right Tool Looks Wrong


So, normally when you get the go ahead you move on, but this really bothered me.

My code is below, and I noticed in the output window it had not one, but two errors, so I'm confused. Did I do the exercise correctly, or not?

evens = my_array >= % 2 == 0 ? puts "#{evens}" : nil


I don't understand what exactly are you trying to do here.
Post full code please.
but what I got from your code is this:

my_array = [6, 4, 2]
evens = do |x| x.to_i % 2 == 0 end
puts "#{evens}"


This exercise:

Instructions: Let's get a little inventive. Write a loop that only puts the even values of my_array. (Bonus points if you use a one-line if!)

Then it gave me the following array to start with:

my_array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]