Transfer practice · Return 6 from points(). Let the caller add 2 before displaying it. The actual output should be the number 8.
v3 · Activity 1 of 1 · return-values · 4 min Runs here
Use a familiar idea in a different task. Read the changed requirement before running.
Return 6 from points(). Let the caller add 2 before displaying it. The actual output should be the number 8.
8
Lines must stay in order. Spelling, capitalization and spaces inside a message matter.
local function points()
return 5
end
print(points())Run the starter to see the current behavior, then make the change in the task.
New syntax: return
return gives a value back to the code that called the function. The caller can pass that value to print(). Printing inside a function and returning a value serve different purposes.
Select a word or symbol in this authored example. Your editor draft stays unchanged.
points
5
pointsThis 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.