Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Answer is incorrect #65

Open
ncaron opened this issue Jan 14, 2018 · 0 comments
Open

Answer is incorrect #65

ncaron opened this issue Jan 14, 2018 · 0 comments

Comments

@ncaron
Copy link

ncaron commented Jan 14, 2018

http://www.codequizzes.com/ruby/beginner/symbols-array-methods-hashes

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant