You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What does the following code return?
snowy_owl = { "type"=>"Bird", "type" => "Owl", "diet"=>"Carnivore", "life_span"=>"10 years" }
puts snowy_owl
Answer
{"type"=>"Owl", "diet"=>"Carnivore", "life_span"=>"10 years"}
Notice that the second key/value pair with the key "type" is included. Every key in a hash must be unique.
But puts always returns nil. So the answer on the site is incorrect or it should be asking what does it print.
The text was updated successfully, but these errors were encountered:
http://www.codequizzes.com/ruby/beginner/symbols-array-methods-hashes
Answer
But
puts
always returnsnil
. So the answer on the site is incorrect or it should be asking what does it print.The text was updated successfully, but these errors were encountered: