Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Ruby Basics Strings Escape Sequences

Elizabeth Naves
Elizabeth Naves
39,088 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
35,170 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)

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