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 (Retired) How Ruby Works The Ruby Programming Language

how do i say "hello world!' ive tried things that i thought was right

its the question on the quiz

2 Answers

Hi Alec,

You have to put string on the screen and use "print"

print "Hello World!"

that didn't work

Try this way

puts "Hello World!"
Brandon Barrette
Brandon Barrette
20,485 Points

So remember to print something to the screen you have:

print "Hello World!"

which will not end in a new line character (which means all text afterwards will stay on the same line) Then there is

puts "Hello World!"

This has a new line character so only "Hello World!" will be on that line. Notice that:

print "Hello World!\n"

(where \n means newline) is equivalent to

puts "Hello World!"

prints hello world and puts doesn't work

Brandon Barrette
Brandon Barrette
20,485 Points

It's print not plural and puts plural. They are two separate methods. One automatically puts in a newline (puts) and the other does not (print).