Creating a Lambda


I made it this way, only that it does not display anything

first_half = lambda do |t,n| n <"M"

Next code is not requiere by exercise, but allows coder to see displays from m backwards.
n =


But you're not asking to display anything in this code.


yep, check this: n =


That's not a display, that's an assignation. Ruby will show it to you because it's the last expression of the program, but it's not part of the output.

What's the exercise? Do they ask explicitly for output (print or puts) or not?


Oh, you have opened two threads, you should delete this one then.


Well, just use the single quotation mark and that should resolve it.

Just like this:

first_half = lambda { |x,y| y <'M'}


first_half = lambda do |x,v| v <'M' end


An assignation is a tryst. The better term to use is assignment. Just for semantics.

This is the lesson with the same title as this topic: