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
1
local name = "Ada"2
print("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
| Step / line | What happens | State after step | Output so far |
|---|---|---|---|
| Create a local variable. | name = "Ada" | — | |
| Concatenate the two strings and print. | name = "Ada" | Hello, Ada |