About 541,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 ...

    Often, people try to use print in a loop inside a function in order to see multiple values, and want to be able to use the results from outside. They need to be returned, but return exits the …

  6. Mastering the `return` Statement in Python Functions

    Jan 29, 2025 · Understanding how the `return` statement works is essential for writing effective and robust Python code. This blog post will delve deep into the fundamental concepts, usage …

  7. Python return Statement - Explained with Examples - Python

    Learn how the return statement works in Python functions. Includes single and multiple return values, syntax, examples, and best practices.

  8. Python Return Statement: The Complete Guide - TheLinuxCode

    May 21, 2025 · When Python executes the return statement, two things happen: To truly appreciate the return statement, it helps to understand its origins. The concept of returning …

  9. The Python Return Statement : Usage and Best Practices

    The return statement in Python is used to exit a function and return a value to the caller. It allows you to pass back a specific result or data from a function, enabling you to utilize the output for …

  10. Python Return Statement - Syntax, Usage, and Examples - Mimo

    Quick Answer: What Does return Do in Python? The return statement in Python has two primary purposes: It immediately exits a function. It sends a value back to where the function was …