Ruby Ruby Basics Strings Escape Sequences

Elizabeth Naves
Elizabeth Naves
38,778 Points

Can somebody please explain why this is wrong?

Bummer! (eval):1: syntax error, unexpected $undefined puts \n ^ (eval):2: syntax error, unexpected $undefined puts \t ^ (eval):3: syntax error, unexpected $undefined puts \" ^ (eval):3: unterminated string meets end of file Restart

program.rb
puts  \n
puts  \t
puts  \"

2 Answers

Ben Reynolds
Ben Reynolds
32,062 Points

Each of these three special characters works when used inside a string (for this challenge you can use any strings you like for each line)

Edward Rutz
Edward Rutz
6,063 Points

Hi Elizabeth, You are missing a string value after your puts command. After you call "puts" you need to type a string/text like "happy, happy, happy" then add the new line or tab character. The third puts call involves a string that has quotes within quotes. A string is a sequence of characters and is placed within single ('happy') or double quotes ("happy")

Happy coding...Edward