v3 · Activity 2 of 8 · local-variables · variable-reading · 3 min Runs here
coins is a name for a value your program can use. Change the value stored on the first line; print(coins) will read that value.
Change the starting amount from 10 to 20. Keep a local variable and display its stored numeric value.
20
Lines must stay in order. Spelling, capitalization and spaces inside a message matter.
local score = 7
print(score)The name score refers to the stored number 7.
This activity reuses syntax you have already met.
local introduces a local variable. coins is its name, = assigns a value, and 10 is the starting value. Without quotation marks, print(coins) reads the value under that name.
Select a word or symbol in this authored example. Your editor draft stays unchanged.
10
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.