v3 · Activity 2 of 12 · return-values · 4 min Runs here
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.
Change the returned number from 5 to 8. Leave print(points()) so the caller displays the returned number.
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.