"Data Structures" "Iterating Over Hashes" error


#1

https://www.codecademy.com/courses/ruby-beginner-en-F3loB/2/4

In the console it says

The Batman:Bruce Wayne
Superman:Clark Kent
Wonder Woman:Diana Prince
Freakazoid:Dexter Douglas
{"The Batman"=>"Bruce Wayne", "Superman"=>"Clark Kent", "Wonder Woman"=>"Diana Prince", "Freakazoid"=>"Dexter Douglas"}

and also this popup appears:


Code:

secret_identities = {
  "The Batman" => "Bruce Wayne",
  "Superman" => "Clark Kent",
  "Wonder Woman" => "Diana Prince",
  "Freakazoid" => "Dexter Douglas"
}
secret_identities.each{|f,n| puts "#{f}:#{n}"}


#2

Your code looks fine. Please refresh and see.


#3

@bayoishola20

I tried and the output is the same.


#4

Try spacing things up or change variables. See below:

secret_identities.each { |x, y| puts "#{x}: #{y}" }


#5

@bayoishola20
Once again, you code worked. :open_mouth:


#6

Lol! But if you did as I suggested, it really should have worked.

Maybe there's something to using f and n in Ruby?


#8