20. Creating A Lambda


#1



https://www.codecademy.com/courses/ruby-beginner-en-L3ZCI/3/4?curriculum_id=5059f8619189a5000201fbcb#


I am totally lost right now. I have no idea what i am doing..could someone help me out please. Error Message : Make sure you put the capital M in quotes like this 'M'


crew = {
  captain: "Picard",
  first_officer: "Riker",
  lt_cdr: "Data",
  lt: "Worf",
  ensign: "Ro",
  counselor: "Troi",
  chief_engineer: "LaForge",
  doctor: "Crusher"
}
# Add your code below!
 first_half = lambda { |x| 'M' < x}


#2

Hi your lambda should have a key/value like that

lambda {|key,value| ...}

then you should put the value less than "M" inside your lambda
Hope that could help you.


#3

In hashes, you have to have two parameters for both the values, so, you have to add another parameter and then say the rest of the code.

Ex. Do:


first_half = lambda { |x, (**your second parameter**)| 'M' < (**Your second parameter**}


Don't Do:


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