Redacted! 5/6 Control Flow Know How - confused?!


#1

I cannot get my head around this - not sure what I'm doing wrong...

code is -

puts "text needed"
text = gets.chomp
puts "redact"
redact = gets.chomp

words = text.split(" ")

words.each do |word|

if words == redact
    print "REDACTED"
else
    print words + " "
end
end

It tells me - 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!).


#2

Error: Oops, try again. Make sure to print each word from the user's text to the console

so here

print words + " "

what is words? what should you print?


#3

Aaaah thank you! So obvious once you see it...


#5