RosettaCodeData/Task/Associative-array-Iteration/Ruby/associative-array-iteration-2.rb

12 lines
180 B
Ruby
Raw Permalink Normal View History

2016-12-05 22:15:40 +01:00
for key, value in my_dict
2015-02-20 00:35:01 -05:00
puts "key = #{key}, value = #{value}"
end
2016-12-05 22:15:40 +01:00
for key in my_dict.keys
2015-02-20 00:35:01 -05:00
puts "key = #{key}"
end
2016-12-05 22:15:40 +01:00
for value in my_dict.values
2015-02-20 00:35:01 -05:00
puts "value = #{value}"
end