About 760,000 results
Open links in new tab
  1. Difference between return and print in Python - GeeksforGeeks

    Jun 5, 2023 · 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 …

  2. Difference between returns and printing in python? [duplicate]

    print: gives the value to the user as an output string. print(3) would give a string '3' to the screen for the user to view. The program would lose the value. return: gives the value to the program.

  3. What is the formal difference between "print" and "return"?

    Dec 11, 2017 · With print() you will display to standard output the value of param1, while with return you will send param1 to the caller. The two statements have a very different meaning, …

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

    print() is a function that causes a side effect (it writes a string in the console), but execution resumes with the next statement. return causes the function to stop executing and hand a …

  5. Print Vs Return in Python: The Ultimate Showdown

    Sep 24, 2023 · Print and return are two keywords that may cause confusion while working in Python. Both are used to provide an output to the code, but their methods of implementation …

  6. 12.13. ‍ Print vs. return — Foundations of Python Programming

    Many beginning programmers find the distinction between print and return very confusing, especially since most of the illustrations of return values in intro texts like this one show the …

  7. Python Print Function Vs. Return statement: Extracting the …

    Oct 20, 2023 · The print statement is a function, while the return statement is a Python keyword. The print statement can be used anywhere in the code. The return statement is only used in …

  8. Understanding `return` vs `print` in Python - CodeRivers

    Apr 7, 2025 · In Python, `return` and `print` are two crucial statements that serve different purposes, yet they can sometimes be confused, especially for beginners. `return` is mainly …

  9. How to Differentiate Between the Return Statement and Print

    Nov 23, 2024 · The print() function outputs values to the console but does not return any value to the calling context of the program. In contrast, the return statement effectively ends the …

  10. Why Your Python Function Isn’t Returning Anything: print() vs return ...

    At a glance, print () and return might seem similar, but they serve very different purposes: print () displays a value on the console but doesn’t store it. return sends a value back from a...

  11. Some results have been removed
Refresh