Created
October 27, 2017 09:35
-
-
Save DonMat/2ad2536dd3eb7813dd71819e501e480c to your computer and use it in GitHub Desktop.
Infakt_workshops_challenge_1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def passed_or_failed(hash, threshold) | |
result = {} | |
result[:passed] = hash.select{|k,v| v.to_i >= threshold.to_i} | |
result[:failed] = hash.select{|k,v| v.to_i < threshold.to_i} | |
result | |
end | |
hash = {"Mark" => 10, "Ellen" => 65, "Roger" => 20, "Mike" => "70"} | |
puts passed_or_failed(hash, "65") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment