Ruby Basics

Store text and print it.

Ruby
name = "Ada"
puts "Hello, #{name}"
Output
Hello, Ada

Explanation

Assignment binds a value to a name. String interpolation inserts an expression inside double-quoted text. puts writes a line.

Explore the dry run
Guided walkthroughReady
1name = "Ada"
2puts "Hello, #{name}"

Follow the example

Start to inspect the source, values, and output. These prepared steps explain the published sample; grouped loop steps describe multiple iterations.

View the complete dry-run table
Prepared trace of the published program. Some rows group repeated iterations.
Step / lineWhat happensState after stepOutput so far
Assign the string to name.name = "Ada"
—
Interpolate name and write a line.name = "Ada"
Hello, Ada