Lesson 5


#1

Here is the code.As the remark in the editor says "You have not added the key value pairs . pl tell me what and where key value pairs is to be added in the code below

puts "Text please: "
text = gets.chomp
words = text.split(" ")
frequencies = Hash.new(0)
words.each { |word| frequencies[word] += 1 }
frequencies = frequencies.sort_by {|a, b| b }
frequencies.reverse!

#2

You got a free edit. Please look around the forum for instructions on how to make all your code look this way when posting. Now that it is formatted, expect an answer shortly.

Just so we're sure, is this the lesson?

https://www.codecademy.com/en/courses/ruby-beginner-en-693PD/0/6