About 504,000 results
Open links in new tab
  1. The Python return Statement: Usage and Best Practices

    See how Python return values work, including multiple results, so you write clear, testable functions. Follow examples and practice as you go.

  2. Python return statement - GeeksforGeeks

    Dec 10, 2024 · When the return statement is executed, the function terminates and the specified value is returned to the caller. If no value is specified, the function returns None by default.

  3. Python Return Function [With Examples]

    Oct 30, 2024 · In this Python article, you learn everything about the Python return function with multiple examples, such as what happens when you don’t use the return statement.

  4. Python return Keyword - W3Schools

    Definition and Usage The return keyword is to exit a function and return a value.

  5. python - What is the purpose of the return statement? How is it ...

    return makes the value (a variable, often) available for use by the caller (for example, to be stored by a function that the function using return is within). Without return, your value or variable …

  6. Returning Functions from Functions in Python - GeeksforGeeks

    Oct 4, 2025 · In Python, functions are first-class objects, meaning they can be assigned to variables, passed as arguments, or even returned from other functions. This feature is widely …

  7. Return List from Function - Python - GeeksforGeeks

    Jul 23, 2025 · Our task is to return a list from a Python function. We'll do this using different techniques—returning static data, computed values and generator-based lists, through short, …

  8. How can I return two values from a function in Python?

    If you want to return more than two values, consider using a named tuple. It will allow the caller of the function to access fields of the returned value by name, which is more readable.

  9. Python - Function Return Value - Stack Overflow

    Sep 6, 2018 · Currently testing on Python 3.6 IDE and PyCharm - apologies for double spacing code - but looks a mess without. Looking for guidance for returning a value from a function.

  10. python: return, return None, and no return at all -- is there any ...

    If any return statement returns an expression, any return statements where no value is returned should explicitly state this as return None, and an explicit return statement should be present …