Iterating over the Array troubles


#1

Hello, I'm getting the error: It looks like you haven't set the frequencies hash correctly.

And this is the hint: The action we want is to update the hash with a key equal to the word, then increment its value by 1. Each key will be frequencies[word], and we can increment using += 1.

What is my problem here?

puts "give me some text"
text = gets.chomp

words=text.split

frequencies = Hash.new(0)
frequencies ["cats"] = "dogs"

frequencies.each { |key| puts key}


#2

Are you asking about 11. Iterating Over Arrays? If yes, here is my code if you want help with it...:slightly_smiling:

CODE:
languages = ["HTML", "CSS", "JavaScript", "Python", "Ruby"]
languages = ["HTML", "CSS", "JavaScript", "Python", "Ruby"]
languages.each { |element| puts element }


#3

I tried using this code and it still said that I didn't print it :confused: