2/6 Getting the users input


#1

Hi

I have the following code:

puts = "Please enter some text"
text = gets.chomp
puts = "Please enter a word to censor"
redact = gets.chomp

After I have entered the first text as prompted and pressed enter then the cursor just jumps to the next line. The second puts is never printed and I'm stuck. If I enter text again and press enter it just throws an error that says

Oops, try again. It looks like you didn't print two prompts for the user to the console using 'puts'.


#2

puts is not a variable, but a program construct for displaying text with a line return afterward.

puts "Please enter some text"
text = gets.chomp
puts "Please enter a word to censor"
redact = gets.chomp

#3

Got it - thanks. Error 40 I guess. Cheers.