Lua Basics

Store a local value and print it.

Lua
local name = "Ada"
print("Hello, " .. name)
Output
Hello, Ada

Explanation

local limits the variable to its scope. The .. operator concatenates strings before print writes the result.

Explore the dry run
Guided walkthroughReady
1local name = "Ada"
2print("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
Create a local variable.name = "Ada"
—
Concatenate the two strings and print.name = "Ada"
Hello, Ada