Lesson 1 of 15

Hello, World!

Your First Ruby Program

Ruby's built-in method for printing output is puts:

puts "Hello, World!"

puts prints the value and adds a newline at the end. You can also use print (no newline) and p (prints the inspect representation):

puts "hello"    # hello
print "hi"      # hi (no newline)
p 42            # 42
p "text"        # "text" (with quotes)

Comments

Single-line comments start with #:

# This is a comment
puts "code"  # This is also a comment

Your Task

Print exactly Hello, World! using puts.

ruby.wasm loading...
Loading...
Click "Run" to execute your code.