[solved small typo][8/21]Why Procs? Just can't pass it


#1

Here's my codes, just keep giving me error. I'm freaking crazy about it. I"ve cleared out all unneccessary spaces, but still can't pass it. :joy:

group_1 = [4.1, 5.5, 3.2, 3.3, 6.1, 3.9, 4.7]
group_2 = [7.0, 3.8, 6.2, 6.1, 4.4, 4.9, 3.0]
group_3 = [5.5, 5.1, 3.9, 4.3, 4.9, 3.2, 3.2]

over_4_feet = Proc.new{|x| x>=4}
can_ride_1 = group_1.select{&over_4_feet}
can_ride_2 = group_2.select{&over_4_feet}
can_ride_3 = group_3.select{&over_4_feet}

error messages:
(ruby):5: syntax error, unexpected tAMPER
can_ride_1 = group_1.select{&over_4_feet}
^
(ruby):6: syntax error, unexpected tAMPER
can_ride_2 = group_2.select{&over_4_feet}
^
(ruby):7: syntax error, unexpected tAMPER
can_ride_3 = group_3.select{&over_4_feet}

thanks for any suggestion


#2

oh I know it! I should use () instead of {} for .select{&over_4_feet}