13. Help witht "Iterating Over Hashes"


May someone help me with this please ?
I don't understand the error message on this ...

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

identites_secretes.each do |superhero, real name|
    puts "#{superhero}: #{real name}"

And this is the answer I have:

(ruby):7: syntax error, unexpected tIDENTIFIER, expecting '|'
identites_secretes.each do |superhero, real name|
(ruby):8: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '('
    puts "#{superhero}: #{real name}"
(ruby):9: syntax error, unexpected keyword_end, expecting $end

Thanks !



unexpected tIDENTIFIER, expecting '|'

To the interpreter, this looks like two variables, not one.


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