Hello World
Collapse Content
Show 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
Code | Output |
---|---|
| hello |
| goodbyeworld |
| 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.