PYTHON BASICSChapter 4 · Functions
Sending data back
A function can calculate a result and send it back to the caller using the return keyword. Once a function returns, it exits immediately. If you do not write return, the function returns None.
Worked example
How it reads
- **return x * 2** calculates the value and immediately finishes the function
- result = double(10) captures the returned value (20) and stores it in result

Cloud tip: Do not confuse print() and return. print() displays text to the screen, while return passes data back to your code so you can use it in other calculations.


