Code works, but am told it is incorrect. 5/6 Redacted!


Hello all,

I have completed the exercise and as far as I am concerned it is working correctly - as in it is correctly censoring the words to be hidden. However, I am told it is incorrect, and am not allowed to continue. Please see my code below.

Error message:
Oops, try again. Make sure to print each word from the user's text to the console unless that word is the word to be redacted; if it is, print REDACTED (all caps!).

puts "Tell me your secret"
text = gets.chomp
puts "now tell me which part of that we should hide"
secret = gets.chomp
words = text.split(" ")
words.each do |word|
    if word == secret
        print "REDACTED "
        print word + " "


@afrover Maybe replace the variable secret with redacted like it says here