Haven't set the frequencies correctly



I keep getting this error message, but my code seems to work correctly... Can anyone help?

**Error: **Oops, try again. It looks like you haven't set the frequencies hash correctly. Check the first exercise if you need help!

puts "Text Here: "
text = gets.chomp
words = text.split
frequencies = Hash.new(0)
words.each {|y| puts frequencies[y] += 1}
words = words.sort_by {|word, freq| freq }


Remove puts. We cannot print and assign in the same statement.


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