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

    In this step-by-step tutorial, you'll learn how to use the Python return statement when writing functions. Additionally, you'll cover some good programming practices related to the use of return. With this knowledge, you'll be able to write readable, robust, and maintainable functions in …

  2. Python return statement - GeeksforGeeks

    Dec 10, 2024 · A return statement is used to end the execution of the function call and it “returns” the value of the expression following the return keyword to the caller. The statements after the return statements are not executed.

  3. Python return Keyword - W3Schools

    The return keyword is to exit a function and return a value. Statements after the return line will not be executed: print("Hello, World!") Define a function using the keyword def. Read more about functions in our Python Functions Tutorial. Python Keywords.

  4. What is Python Return Statement? - Python Guides

    Jan 8, 2025 · In this tutorial, I have explained what is Python return statement. I discussed the syntax of return statements, how to return multiple values , how to use return with conditional statements and a real-time example .

  5. Python Return Statements Explained: What They Are and Why …

    Jan 4, 2020 · All functions return a value when called. If a return statement is followed by an expression list, that expression list is evaluated and the value is returned: ... If no expression list is specified, None is returned: ... return # No return expression list.

  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 methods, common practices, and best practices related to the return statement in Python functions. A function in Python is a block of reusable code that performs a specific task.

  7. Python's return Method: A Comprehensive Guide - coderivers.org

    Mar 28, 2025 · In Python programming, the return statement plays a crucial role in functions. It is the mechanism by which a function can send a value (or values) back to the code that called it. Understanding how the return method works is essential …

  8. Mastering the `return` Statement in Python - CodeRivers

    Apr 10, 2025 · In Python, the return statement is a crucial part of function programming. It allows a function to send a value or a set of values back to the code that called the function. Understanding how to use return effectively is essential for …

  9. return | Python Keywords – Real Python

    In Python, the return keyword exits a function and returns a value back to the caller. It allows you to send results back from a function so that you can use them elsewhere in your program. If no value is specified, return will return None by default. Python return Keyword Examples. Here’s an example to illustrate how the return keyword is ...

  10. Python return Statement - AskPython

    May 11, 2023 · Python return statement terminates the function and return the value to the caller. Python return multiple values, return null, return list, return keyword.

Refresh