Oops, try again. Did you create a variable called a_to_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 { |k,v| v <"M"}
a_to_m = crew.select (&first_half)


If we use ( ) to pass arguments to a method in Ruby, there can't be a space between the method name (in this case select) and (. It can get quite confusing when we're switching between passing a block to the select method using { } and then passing procs and lambdas directly as arguments using ( ).

If you do crew.select(&first_half) instead of crew.select (&first_half) that will clear the error up and you can move on.


really helpful.. thx (it means a lot):smiley:


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