4. Redacted


#1



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


Oops, try again. It looks like you didn't print each word from the user's text to the console.


puts "Type a sentence. "
text = gets.chomp
puts "Word to redact: "
redact = gets.chomp

words = text.split(" ")

words.each do |word|
if word == redact
print "REDACTED "
else
print word + " "
end
end

What is happening? tried everything


#2

For this lesson we are only asked to print out the words.

words.each do |word|
    print word
end

#3

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