AI engineering glossary · Python core

What is return value?

Return value: The result a function sends back to its caller with the return statement, which also ends the function immediately. A function with no return statement returns None. It can return several values as a tuple.

Level: beginnerTopic: Python core

Return value: an example

def stats(nums): return min(nums), max(nums) gives (2, 9) for [2, 5, 9], which can be unpacked as lo, hi.

Related terms

More Python core terms

Where you learn it

Return value is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.