Lesson 24: return — Sending Back a Value
The return statement gives a value back from a function. The caller can store it in a variable and reuse it.
print displays, but return sends back. We can capture it: x = double(3).
- return
- Sends a value from the function back to the caller.
- None
- A special value meaning "no value". A function without return gives it back automatically.