Stuck on Redacted 5/6 - Control flow


#1

Hi everyone,

I hate to be that person, but this is driving me nuts. I can't seem to get Part 5 - Control Flow quite right. Could someone please have a look at my code and let me know what I am doing wrong?

https://www.codecademy.com/en/courses/ruby-beginner-en-mzrZ6/0/5?curriculum_id=5059f8619189a5000201fbcb

puts "Enter your sensitive text:"
text = gets.chomp
puts "Enter terms to redact:"
redaction_text = gets.chomp
words = text.split(" ")
words.each do |word|
    if word == redaction_text
        print "REDACTED "
    else
        print word + " "
    end
end

Thanks and regards to anyone who can assist.


#2

Hi,
This code works, I just tried it.
What kind of error are you getting? Perhaps it has to do with the browser you're using? It works on Chrome though.


#3

Hey, thanks for checking this for me! I was using chrome. I have tried again just now, same code, and it went through fine, I'm, on to the next lesson. For reference, while I've forgotten the exact text, the error I was getting was the generic "your code is not working quite right" one for this lesson, telling me that the sensitive text needed to be replaced with "REDACTED " in all caps.


#4

i get this 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!).
i am using firefox :sweat:


#5

never mind it fixed itself


#6

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