Iterating over the array


it seems that i have the same code as everyone else here but i get the following error message

can't convert String into Integer

puts "tell me something:"
text = gets.chomp
words = text.split()

frequencies =

words.each do |word|
    frequencies=frequencies[word] += 1


i realise my error now. can i delete this post?


You most definitely can!


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