Last active
August 29, 2015 14:26
-
-
Save mendelB/3f0a03a9adf0e538de09 to your computer and use it in GitHub Desktop.
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
flatiron_school = {:teachers=>[{:name=>"steph"}, {:name=>"uzo"}, {:name=>"blake"}], :students => [{:name => "giancarlo", :grade => 100, :address => "bronx"},{:name => "jamie", :grade => 200, :address => "NJ"}]} | |
flatiron_school.each_pair do |k, v| | |
v.each do |e| | |
e.each_pair do |key, value| | |
puts value if key == :name | |
end | |
end | |
end | |
def print_specific_elements(hash, element) | |
hash.each_pair do |k, v| | |
v.each do |e| | |
puts e[element] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment