Transfer practice · Start a local value at 3. Add 2 twice to that same variable, then display its final numeric value 7.
v3 · Activity 1 of 1 · assignment · state-updates · 3 min Runs here
Use a familiar idea in a different task. Read the changed requirement before running.
Start a local value at 3. Add 2 twice to that same variable, then display its final numeric value 7.
7
Lines must stay in order. Spelling, capitalization and spaces inside a message matter.
local score = 2
score = score + 4
print(score)The update stores 6, which the final print reads.
New syntax: coins = coins + 5
Worked example: read 10, add 5, store 15, then print 15. This describes the shown code; it is not an execution trace of other programs.
= is an update operation. It does not mean the two sides are mathematically equal.
Select a word or symbol in this authored example. Your editor draft stays unchanged.
10
5
This explains the fixed example above.
This is a private experiment copy. It does not replace your answer or complete the activity.
Your output will appear here.
Replace this code with the starter? Download your draft to keep a copy.
Your output will appear here.
Sign in with RoCreators to save private progress across devices. Community verification is separate.