Transfer practice · Predict the two outputs, then run: first display 4 + 3, then display the text "4 + 3". One instruction calculates; the other shows the expression as text.

← Back to journey

Bring a small lobby to life

Let code do the addition: practice

v7 · Activity 1 of 1 · Scores · 2 min Runs here

Workshop progress · step 6 of 1
Optional learning visualization
Scene choices
Chapter outline
Loading draft…
Activity 6 · Scores

Use a familiar idea in a different task. Read the changed requirement before running.

Your task

Predict the two outputs, then run: first display 4 + 3, then display the text "4 + 3". One instruction calculates; the other shows the expression as text.

Expected output
7
4 + 3

Lines must stay in order. Spelling, capitalization and spaces inside a message matter.

Syntax in this activity

New syntax: +

Earlier ideas used here
  • numbers
  • printing
What this exercise checks

Actual Output · exact lines and order · extra output forbidden.

Successful execution is required. A compile error, runtime error or execution limit never completes this task.

Whitespace, matching single or double quotes, and different variable names are allowed. Output-only tasks accept any valid Luau solution meeting the displayed result and value types. Construct tasks use the stated straight-line form.

Lesson requirements: addition. These are exercise requirements, not Luau syntax rules.

Compare two programs

Predict which one calculates. Run both to see their actual Output. This experiment does not change your answer.

Calculate a value

print(12 + 8)

Display literal text

print("12 + 8")
Explain this code

Select a word or symbol in this authored example. Your editor draft stays unchanged.

  
Choose a highlighted part to see what it means.
Your goal

Predict the two outputs, then run: first display 4 + 3, then display the text "4 + 3". One instruction calculates; the other shows the expression as text.

Run code to see what happens. Check solution to test the activity.

Reset starter

Replace this code with the starter? Download your draft to keep a copy.

Code

Luau
Luau keyword highlighting · Ctrl/⌘ + Enter: Run · Esc: leave editor

Your output will appear here.

Ready