Hello World


Collapse Content

To print to output in ruby, use the built-in method print. To print with a newline at the end, use puts. In ruby, you do not need to include parentheses when calling a method.

Examples

CodeOutput
print "hello"
hello
print "goodbye"
print "world"
goodbyeworld
puts "goodbye"
puts "world"
goodbye
world

Challenge

Traditionally, people print "hello world" as their first program. Print "hello world" to the output three times, with each phrase on its own line.

Please sign in or sign up to submit answers.

Alternatively, you can try out Learneroo before signing up.

Contact Us
Sign in or email us at [email protected]