When.com Web Search

Search results

  1. Results From The WOW.Com Content Network
  2. The Python return Statement: Usage and Best Practices

    realpython.com/python-return-statement

    The Python return statement is a special statement that you can use inside a function or method to send the function’s result back to the caller. A return statement consists of the return keyword followed by an optional return value.

  3. Python return statement - GeeksforGeeks

    www.geeksforgeeks.org/python-return-statement

    In Python, we may use the print statements to display the final output of a code on the console, whereas the return statement returns a final value of a function execution which may be used further in the code. In this article, we will learn about Python return and print statements.

  4. The Python Return Statement : Usage and Best Practices

    pythongeeks.org/python-return-statement

    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 further computation or processing.

  5. Python return Keyword - W3Schools

    www.w3schools.com/python/ref_keyword_return.asp

    The return keyword is to exit a function and return a value. More Examples. Example. Statements after the return line will not be executed: def myfunction (): return 3+3. print("Hello, World!") print(myfunction ()) Try it Yourself » Related Pages. Define a function using the keyword def. Read more about functions in our Python Functions Tutorial.

  6. Python Return Statements Explained: What They Are and Why You Use...

    www.freecodecamp.org/news/python-return-statements-explained-what-they-are-and...

    Python Return Statements Explained: What They Are and Why You Use Them. 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: >>> def greater_than_1(n): ... return n > 1.

  7. The return statement is used when a function is ready to return a value to its caller. For example, here's a function utilizing both print() and return : def foo(): print("hello from inside of foo") return 1

  8. Python return Statement - AskPython

    www.askpython.com/python/python-return-statemen

    In Python, the return statement exits a function and returns the specified value to the caller. Multiple return statements may exist in a function, but only the one that fulfils the specified condition first is executed.

  9. Python Return Statement: Complete Guide | by ryan | Oct, 2024 -...

    medium.com/@ryan_forrester_/python-return-statement-complete-guide-138c80bcfdc7

    The `return` statement might seem simple at first glance, but understanding its nuances can make a big difference in how you write Python code. Let’s dive into how `return` works and...

  10. Using the Return Statement in Python - CodingDrills

    www.codingdrills.com/tutorial/python-tutorial/return-statement-python

    In this tutorial, we will delve into the concept of using the return statement in Python functions to return values. Through practical examples, we will understand its significance and how it contributes to writing clean and modular code.

  11. Using the Python return Statement Effectively (Overview)

    realpython.com/lessons/python-return-overview

    In this course, you will learn how to write a Python return statement, how you can return single and multiple values with a return statement, and what are the best practices for using the Python return statement.