15. More methods more solutions


#1



https://www.codecademy.com/en/courses/ruby-beginner-en-Qn7Qw/2/5?curriculum_id=5059f8619189a5000201fbcb

What does the " " mean?


my_hash = { one: 1, two: 2, three: 3 }

my_hash.each_key { |k| print k, " " }
# ==> one two three

my_hash.each_value { |v| print v, " " }
# ==> 1 2 3


#2

its a string containing a space


#3

if you would do:

my_hash.each_value { |v| print v, "-" }

you would get:

1-2-3

so the " " is the separator so to speak


#4

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