Syntex error


#1

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


#2

The first prompt would be for a phrase:

puts "Enter some text: "
text = gets.chomp

The second prompt would be for the word to redact

puts "Enter a word to redact from text: "
redact = gets.chomp

Don't define the text in your code. Enter it at the prompt.

words = text.split(' ')

Keep your print statements plain (do not use string interpolation).

if x != redact
    print word + " "
else
    print "REDACTED "
end

#3

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