"control flow know-how" need advice here


i've read lots of code in the topics. but still have no idea how to correct my code.
really need help here.
please kindly check my code and tell me how to correct it

puts "please type your keyword"
puts "redact words"
words=text.split(" ")
words.each do|word|
if word==redact
    print "REDACTED"   
print word +" "


i just saw someone said there was a bug with this exercise here.
anybody help?


Hey samarcici

You just need to change print "REDACTED" to print "REDACTED ", so that it includes the extra space after the print, similar to what you do in the else statement.


thank you for your help. i've already passed this exercise. but i didn't change my code. i don't know what's the reason.