{"id":28066,"date":"2023-09-24T15:20:48","date_gmt":"2023-09-24T09:50:48","guid":{"rendered":"http:\/\/www.pythonpool.com\/?p=28066"},"modified":"2026-07-13T12:43:24","modified_gmt":"2026-07-13T07:13:24","slug":"print-vs-return-in-python","status":"publish","type":"post","link":"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/","title":{"rendered":"print() vs return in Python: Differences, Examples, and Best Practices"},"content":{"rendered":"<p><strong>Quick answer:<\/strong> Use print() to send display-oriented output to a stream and use return to send a value from a function back to its caller. A returned value can be stored, tested, transformed, or printed later; print() returns None.<\/p>\n<figure class=\"pythonpool-article-visual\"><img src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/print-vs-return-python-b095.png\" alt=\"Python Pool infographic comparing print output with return values, function flow, reuse, and tests\" width=\"1536\" height=\"1024\" loading=\"lazy\" decoding=\"async\"><figcaption>Use return to send a value through program logic; use print when the result needs to be shown at the program boundary.<\/figcaption><\/figure>\n<p>The difference between <code>print()<\/code> and <code>return<\/code> in Python is simple: <code>print()<\/code> displays text to an output stream, while <code>return<\/code> sends a value back to the code that called the function. Use <code>print()<\/code> when a human needs to see output. Use <code>return<\/code> when another part of the program needs to use the result.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #990303;color:#990303\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #990303;color:#990303\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#Quick_Example\" >Quick Example<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#What_print_Does\" >What print() Does<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#What_return_Does\" >What return Does<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#print_Returns_None\" >print() Returns None<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#Use_return_for_Calculations\" >Use return for Calculations<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#Use_print_for_User-Facing_Output\" >Use print() for User-Facing Output<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#Return_Can_Stop_a_Function_Early\" >Return Can Stop a Function Early<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#Return_Multiple_Values\" >Return Multiple Values<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#Testing_and_Reuse\" >Testing and Reuse<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#print_vs_return_Comparison\" >print() vs return Comparison<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#Keep_Computation_Separate_From_Display\" >Keep Computation Separate From Display<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#Understand_Function_Exit\" >Understand Function Exit<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#Return_None_Deliberately\" >Return None Deliberately<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#Print_Is_Not_Captured_Data\" >Print Is Not Captured Data<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#Choose_Logging_For_Diagnostics\" >Choose Logging For Diagnostics<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#Test_Values_Not_Screen_Output\" >Test Values, Not Screen Output<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#Frequently_Asked_Questions\" >Frequently Asked Questions<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#What_is_the_difference_between_print_and_return_in_Python\" >What is the difference between print() and return in Python?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#What_does_print_return_in_Python\" >What does print() return in Python?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#When_should_a_function_use_return_instead_of_print\" >When should a function use return instead of print()?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#Can_return_and_print_be_used_together\" >Can return and print() be used together?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Quick_Example\"><\/span>Quick Example<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The easiest way to see the difference is to call two functions that do similar work. One only prints the result. The other returns the result so it can be stored, tested, or passed to another function.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">def print_sum(a, b):\n    print(a + b)\n\n\ndef return_sum(a, b):\n    return a + b\n\nprinted_value = print_sum(2, 3)\nreturned_value = return_sum(2, 3)\n\nprint(printed_value)\nprint(returned_value)\n<\/code><\/pre>\n<\/div>\n<p>The first function displays <code>5<\/code>, but the value assigned to <code>printed_value<\/code> is <code>None<\/code>. The second function sends <code>5<\/code> back to the caller, so <code>returned_value<\/code> can be reused.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"What_print_Does\"><\/span>What print() Does<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The official <a href=\"https:\/\/docs.python.org\/3\/library\/functions.html#print\"><code>print()<\/code> documentation<\/a> defines it as a built-in function that writes objects to a text stream. By default, that stream is standard output. <code>print()<\/code> is useful for command-line messages, quick debugging, examples, and scripts where visible output is the goal.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">name = \"PythonPool\"\nscore = 98\n\nprint(\"Name:\", name)\nprint(\"Score:\", score)\nprint(\"Score:\", score, sep=\" \", end=\"\\n\")\n<\/code><\/pre>\n<\/div>\n<p><code>print()<\/code> is not a data pipeline. It turns objects into text for display. If you need the value later, store it in a variable or return it from a function instead.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"What_return_Does\"><\/span>What return Does<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The Python language reference describes the <a href=\"https:\/\/docs.python.org\/3\/reference\/simple_stmts.html#the-return-statement\"><code>return<\/code> statement<\/a> as the statement that leaves the current function call and optionally returns a value. The Python tutorial also notes in its <a href=\"https:\/\/docs.python.org\/3\/tutorial\/controlflow.html#defining-functions\">function examples<\/a> that falling off the end of a function returns <code>None<\/code>.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">def calculate_total(price, quantity):\n    return price * quantity\n\nsubtotal = calculate_total(19.99, 3)\nfinal_total = subtotal + 4.99\n\nprint(final_total)\n<\/code><\/pre>\n<\/div>\n<p>Returning a value keeps the function reusable. The caller can print the value, save it, compare it, convert it, or pass it into another function.<\/p>\n<p><!-- Python Pool visual layout repair 2026-07-13 --><\/p>\n<figure class=\"pythonpool-article-visual pythonpool-supporting-visual\"><img src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/print-return-output-b178.png\" alt=\"Python Pool infographic showing print output in a terminal versus a returned Python value\" width=\"1536\" height=\"1054\" loading=\"lazy\" decoding=\"async\"><figcaption>Visible output: Print output in a terminal versus a returned Python value.<\/figcaption><\/figure>\n<h2><span class=\"ez-toc-section\" id=\"print_Returns_None\"><\/span>print() Returns None<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>A common beginner mistake is expecting <code>print()<\/code> to return the text it displays. It does not. It returns <code>None<\/code>, Python&#8217;s null object. The official docs describe <a href=\"https:\/\/docs.python.org\/3\/library\/stdtypes.html#the-null-object\"><code>None<\/code><\/a> as the object used to represent the absence of a value.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">message = print(\"Hello\")\n\nprint(message)\nprint(type(message))\n<\/code><\/pre>\n<\/div>\n<p>This is why code like <code>result = print(value)<\/code> almost never does what people expect. Use <code>result = value<\/code> or <code>return value<\/code> instead.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Use_return_for_Calculations\"><\/span>Use return for Calculations<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Functions that calculate, validate, parse, or transform data should usually return a value. That makes them easier to test and combine. For example, a helper that checks whether a list is empty should return <code>True<\/code> or <code>False<\/code>, not only print a message. Our <a href=\"https:\/\/www.pythonpool.com\/python-check-if-list-is-empty\/\">Python list empty<\/a> guide covers related checks.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">def is_empty(items):\n    return len(items) == 0\n\nvalues = []\n\nif is_empty(values):\n    print(\"No values found\")\n<\/code><\/pre>\n<\/div>\n<p>Returning the boolean lets the caller decide what to do next. One caller may print a message, while another may raise an error or load default data.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Use_print_for_User-Facing_Output\"><\/span>Use print() for User-Facing Output<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><code>print()<\/code> is appropriate at the edge of a program: command-line output, teaching examples, simple scripts, and debugging checkpoints. It is also useful after reading input from a user, where the purpose is to show feedback. For more input patterns, see <a href=\"https:\/\/www.pythonpool.com\/python-user-input\/\">Python user input<\/a>.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">def greeting(name):\n    return f\"Hello, {name}!\"\n\nuser_name = \"Ada\"\nprint(greeting(user_name))\n<\/code><\/pre>\n<\/div>\n<p>Notice the structure: the function returns a string, and the outer code prints it. This keeps the business logic separate from display logic.<\/p>\n<figure class=\"pythonpool-article-visual pythonpool-supporting-visual\"><img src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/print-return-value-b178.png\" alt=\"Python Pool infographic mapping return from a function to a caller, variable, and reusable value\" width=\"1536\" height=\"1054\" loading=\"lazy\" decoding=\"async\"><figcaption>Return value: Return from a function to a caller, variable, and reusable value.<\/figcaption><\/figure>\n<h2><span class=\"ez-toc-section\" id=\"Return_Can_Stop_a_Function_Early\"><\/span>Return Can Stop a Function Early<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>A <code>return<\/code> statement exits the function immediately. This is useful for guard clauses, validation, and search functions. Once Python reaches <code>return<\/code>, later statements in that function are skipped.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">def find_first_even(numbers):\n    for number in numbers:\n        if number % 2 == 0:\n            return number\n    return None\n\nprint(find_first_even([1, 3, 8, 9]))\nprint(find_first_even([1, 3, 5]))\n<\/code><\/pre>\n<\/div>\n<p>Returning <code>None<\/code> explicitly can make the missing-value case clear. If your code later calls a value as a function, check whether the value is actually callable; our <a href=\"https:\/\/www.pythonpool.com\/python-callable\/\">Python callable<\/a> guide explains that pattern.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Return_Multiple_Values\"><\/span>Return Multiple Values<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Python functions can return multiple values by returning a tuple. This is helpful when a function naturally produces related results, such as a minimum and maximum, a status and message, or a removed value and updated collection.<\/p>\n<div class=\"pythonpool-code-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<pre><code class=\"language-python\">def min_max(numbers):\n    return min(numbers), max(numbers)\n\nlow, high = min_max([4, 8, 2, 10])\n\nprint(low)\nprint(high)\n<\/code><\/pre>\n<\/div>\n<p>For list operations that return removed values, see <a href=\"https:\/\/www.pythonpool.com\/python-list-pop\/\">Python list pop<\/a>. For understanding returned object types, see <a href=\"https:\/\/www.pythonpool.com\/python-data-types\/\">Python data types<\/a>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Testing_and_Reuse\"><\/span>Testing and Reuse<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Return-based functions are easier to test because a test can compare the returned value with an expected value. A function that only prints requires output capture, which is more work and usually less direct. This is why reusable library functions should return data and leave printing to the command-line script, notebook cell, or web view that calls them.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"print_vs_return_Comparison\"><\/span>print() vs return Comparison<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<div class=\"pythonpool-table-scroll\" style=\"max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;\">\n<table>\n<thead>\n<tr>\n<th>Question<\/th>\n<th><code>print()<\/code><\/th>\n<th><code>return<\/code><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Main purpose<\/td>\n<td>Display output<\/td>\n<td>Send value to caller<\/td>\n<\/tr>\n<tr>\n<td>Works inside functions?<\/td>\n<td>Yes<\/td>\n<td>Yes, and exits the function<\/td>\n<\/tr>\n<tr>\n<td>Reusable result?<\/td>\n<td>No, it returns <code>None<\/code><\/td>\n<td>Yes<\/td>\n<\/tr>\n<tr>\n<td>Best for<\/td>\n<td>Messages and debugging<\/td>\n<td>Calculations and program logic<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>In production code, keep most logic in functions that return values. Print only at the boundary where the result needs to be shown to a person.<\/p>\n<figure class=\"pythonpool-article-visual pythonpool-supporting-visual\"><img src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/print-return-flow-b178.png\" alt=\"Python Pool infographic comparing print side effects, return flow, function exit, and composition\" width=\"1536\" height=\"1054\" loading=\"lazy\" decoding=\"async\"><figcaption>Control flow: Print side effects, return flow, function exit, and composition.<\/figcaption><\/figure>\n<h2><span class=\"ez-toc-section\" id=\"Keep_Computation_Separate_From_Display\"><\/span>Keep Computation Separate From Display<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>A function that returns a result can serve a command-line script, notebook, web view, or test without knowing how the result will be presented. Put print() near the program boundary and keep calculations, parsing, and validation in return-based helpers.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Understand_Function_Exit\"><\/span>Understand Function Exit<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>return immediately leaves the current function call. This makes guard clauses and search functions readable, but it also means statements after the return are not executed. Use an explicit final return when the no-result case matters to the caller.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Return_None_Deliberately\"><\/span>Return None Deliberately<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Falling off the end of a function and returning None can be valid when the function performs an action rather than calculates a value. Document that contract so callers do not mistake a side effect for a reusable result.<\/p>\n<figure class=\"pythonpool-article-visual pythonpool-supporting-visual\"><img src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/print-return-check-b178.png\" alt=\"Python Pool infographic testing None, assignment, nested calls, tests, and validation\" width=\"1536\" height=\"1054\" loading=\"lazy\" decoding=\"async\"><figcaption>Function checks: None, assignment, nested calls, tests, and validation.<\/figcaption><\/figure>\n<h2><span class=\"ez-toc-section\" id=\"Print_Is_Not_Captured_Data\"><\/span>Print Is Not Captured Data<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The text visible in a terminal is an output side effect. If another function needs the same information, return the original object or string and let the caller decide whether to print, log, serialize, or ignore it.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Choose_Logging_For_Diagnostics\"><\/span>Choose Logging For Diagnostics<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>print() is useful for short scripts and learning examples, but application diagnostics often need logging levels, timestamps, handlers, and structured context. Returning data and logging operational events solve different problems.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Test_Values_Not_Screen_Output\"><\/span>Test Values, Not Screen Output<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>A return-based function can be tested with direct equality and type assertions. When output is intentionally part of the interface, capture stdout in a focused test, but do not make every internal helper communicate through printed text.<\/p>\n<p>The official <a href=\"https:\/\/docs.python.org\/3\/library\/functions.html#print\">print() documentation<\/a> describes stream output, while the <a href=\"https:\/\/docs.python.org\/3\/reference\/simple_stmts.html#the-return-statement\">return statement reference<\/a> describes leaving a function and returning a value. Related guidance includes <a href=\"https:\/\/www.pythonpool.com\/python-logging\/\">Python logging<\/a> and <a href=\"https:\/\/www.pythonpool.com\/python-testing-framework\/\">testing frameworks<\/a>.<\/p>\n<p>For related function boundaries, compare <a href=\"https:\/\/www.pythonpool.com\/python-callable\/\">callable values<\/a>, <a href=\"https:\/\/www.pythonpool.com\/python-logging\/\">diagnostic logging<\/a>, and <a href=\"https:\/\/www.pythonpool.com\/python-testing-framework\/\">testable Python design<\/a> when deciding where output belongs.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Frequently_Asked_Questions\"><\/span>Frequently Asked Questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"What_is_the_difference_between_print_and_return_in_Python\"><\/span>What is the difference between print() and return in Python?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>print() writes a representation to an output stream, while return sends a value from a function back to its caller and ends that function call.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"What_does_print_return_in_Python\"><\/span>What does print() return in Python?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>print() returns None. The displayed text is output, not the value assigned to a variable.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"When_should_a_function_use_return_instead_of_print\"><\/span>When should a function use return instead of print()?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Use return for calculations, validation, parsing, and reusable logic; print at the boundary where a person or command-line user needs to see a message.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_return_and_print_be_used_together\"><\/span>Can return and print() be used together?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Yes. A function can return a value and the caller can print it, which keeps the function reusable and the presentation decision outside the core logic.<\/p>\n<p><script type=\"application\/ld+json\">{\"@context\":\"https:\/\/schema.org\",\"@type\":\"FAQPage\",\"mainEntity\":[{\"@type\":\"Question\",\"name\":\"What is the difference between print() and return in Python?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"print() writes a representation to an output stream, while return sends a value from a function back to its caller and ends that function call.\"}},{\"@type\":\"Question\",\"name\":\"What does print() return in Python?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"print() returns None. The displayed text is output, not the value assigned to a variable.\"}},{\"@type\":\"Question\",\"name\":\"When should a function use return instead of print()?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Use return for calculations, validation, parsing, and reusable logic; print at the boundary where a person or command-line user needs to see a message.\"}},{\"@type\":\"Question\",\"name\":\"Can return and print() be used together?\",\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Yes. A function can return a value and the caller can print it, which keeps the function reusable and the presentation decision outside the core logic.\"}}]}<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Understand print() vs return in Python with clear examples, None behavior, function design, testing, and practical decision rules.<\/p>\n","protected":false},"author":38,"featured_media":32391,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4047],"tags":[5839,5838,5835,5837,5836],"class_list":["post-28066","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-comparison","tag-does-return-print-in-python","tag-print-and-return-difference","tag-print-or-return-python","tag-return-vs-print","tag-return-vs-print-python-example","infinite-scroll-item"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.1 (Yoast SEO v28.0) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>print() vs return in Python: Differences, Examples, and Best Practices<\/title>\n<meta name=\"description\" content=\"Understand print() vs return in Python with clear examples, None behavior, function design, testing, and practical decision rules.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"print() vs return in Python: Differences, Examples, and Best Practices\" \/>\n<meta property=\"og:description\" content=\"Understand print() vs return in Python with clear examples, None behavior, function design, testing, and practical decision rules.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Pool\" \/>\n<meta property=\"article:published_time\" content=\"2023-09-24T09:50:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-07-13T07:13:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/print-vs-return-python-b095.png\" \/>\n<meta name=\"author\" content=\"Namrata Gulati\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Python Pool\" \/>\n<meta name=\"twitter:description\" content=\"Practical Python tutorials, error fixes, code examples, and project guides.\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/print-vs-return-python-b095.png\" \/>\n<meta name=\"twitter:creator\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:site\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Namrata Gulati\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/print-vs-return-in-python\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/print-vs-return-in-python\\\/\"},\"author\":{\"name\":\"Namrata Gulati\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#\\\/schema\\\/person\\\/294338f378f0853e6af4ca4a5a907ea6\"},\"headline\":\"print() vs return in Python: Differences, Examples, and Best Practices\",\"datePublished\":\"2023-09-24T09:50:48+00:00\",\"dateModified\":\"2026-07-13T07:13:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/print-vs-return-in-python\\\/\"},\"wordCount\":1229,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/print-vs-return-in-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pythonpool.com\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/print-vs-return-python-guide-pythonpool.png\",\"keywords\":[\"does return print in python\",\"print and return difference\",\"print or return python\",\"return vs print\",\"return vs print python example\"],\"articleSection\":[\"Comparison\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pythonpool.com\\\/print-vs-return-in-python\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/print-vs-return-in-python\\\/\",\"url\":\"https:\\\/\\\/www.pythonpool.com\\\/print-vs-return-in-python\\\/\",\"name\":\"print() vs return in Python: Differences, Examples, and Best Practices\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/print-vs-return-in-python\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/print-vs-return-in-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pythonpool.com\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/print-vs-return-python-guide-pythonpool.png\",\"datePublished\":\"2023-09-24T09:50:48+00:00\",\"dateModified\":\"2026-07-13T07:13:24+00:00\",\"description\":\"Understand print() vs return in Python with clear examples, None behavior, function design, testing, and practical decision rules.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/print-vs-return-in-python\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pythonpool.com\\\/print-vs-return-in-python\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/print-vs-return-in-python\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.pythonpool.com\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/print-vs-return-python-guide-pythonpool.png\",\"contentUrl\":\"https:\\\/\\\/www.pythonpool.com\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/print-vs-return-python-guide-pythonpool.png\",\"width\":1350,\"height\":650,\"caption\":\"print vs return in Python guide showing print displays text while return sends a value to the caller\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/print-vs-return-in-python\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pythonpool.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"print() vs return in Python: Differences, Examples, and Best Practices\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#website\",\"url\":\"https:\\\/\\\/www.pythonpool.com\\\/\",\"name\":\"Python Pool\",\"description\":\"Practical Python tutorials, error fixes, code examples, and project guides.\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pythonpool.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#organization\",\"name\":\"Python Pool\",\"url\":\"https:\\\/\\\/www.pythonpool.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.pythonpool.com\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/aa.png\",\"contentUrl\":\"https:\\\/\\\/www.pythonpool.com\\\/wp-content\\\/uploads\\\/2020\\\/08\\\/aa.png\",\"width\":452,\"height\":185,\"caption\":\"Python Pool\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/pythonpool\",\"https:\\\/\\\/www.youtube.com\\\/c\\\/pythonpool\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.pythonpool.com\\\/#\\\/schema\\\/person\\\/294338f378f0853e6af4ca4a5a907ea6\",\"name\":\"Namrata Gulati\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/19c5e6bfbc6202d4017b79f726b2ad5e520491d67ff428a87c071afef23ecd89?s=96&d=wavatar&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/19c5e6bfbc6202d4017b79f726b2ad5e520491d67ff428a87c071afef23ecd89?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/19c5e6bfbc6202d4017b79f726b2ad5e520491d67ff428a87c071afef23ecd89?s=96&d=wavatar&r=g\",\"caption\":\"Namrata Gulati\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"print() vs return in Python: Differences, Examples, and Best Practices","description":"Understand print() vs return in Python with clear examples, None behavior, function design, testing, and practical decision rules.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/","og_locale":"en_US","og_type":"article","og_title":"print() vs return in Python: Differences, Examples, and Best Practices","og_description":"Understand print() vs return in Python with clear examples, None behavior, function design, testing, and practical decision rules.","og_url":"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/","og_site_name":"Python Pool","article_published_time":"2023-09-24T09:50:48+00:00","article_modified_time":"2026-07-13T07:13:24+00:00","og_image":[{"url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/print-vs-return-python-b095.png","type":"","width":"","height":""}],"author":"Namrata Gulati","twitter_card":"summary_large_image","twitter_title":"Python Pool","twitter_description":"Practical Python tutorials, error fixes, code examples, and project guides.","twitter_image":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/print-vs-return-python-b095.png","twitter_creator":"@pythonpool","twitter_site":"@pythonpool","twitter_misc":{"Written by":"Namrata Gulati","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#article","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/"},"author":{"name":"Namrata Gulati","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/294338f378f0853e6af4ca4a5a907ea6"},"headline":"print() vs return in Python: Differences, Examples, and Best Practices","datePublished":"2023-09-24T09:50:48+00:00","dateModified":"2026-07-13T07:13:24+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/"},"wordCount":1229,"commentCount":0,"publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"image":{"@id":"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/print-vs-return-python-guide-pythonpool.png","keywords":["does return print in python","print and return difference","print or return python","return vs print","return vs print python example"],"articleSection":["Comparison"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/","url":"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/","name":"print() vs return in Python: Differences, Examples, and Best Practices","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#primaryimage"},"image":{"@id":"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/print-vs-return-python-guide-pythonpool.png","datePublished":"2023-09-24T09:50:48+00:00","dateModified":"2026-07-13T07:13:24+00:00","description":"Understand print() vs return in Python with clear examples, None behavior, function design, testing, and practical decision rules.","breadcrumb":{"@id":"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pythonpool.com\/print-vs-return-in-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#primaryimage","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/print-vs-return-python-guide-pythonpool.png","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2026\/07\/print-vs-return-python-guide-pythonpool.png","width":1350,"height":650,"caption":"print vs return in Python guide showing print displays text while return sends a value to the caller"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pythonpool.com\/print-vs-return-in-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pythonpool.com\/"},{"@type":"ListItem","position":2,"name":"print() vs return in Python: Differences, Examples, and Best Practices"}]},{"@type":"WebSite","@id":"https:\/\/www.pythonpool.com\/#website","url":"https:\/\/www.pythonpool.com\/","name":"Python Pool","description":"Practical Python tutorials, error fixes, code examples, and project guides.","publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pythonpool.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.pythonpool.com\/#organization","name":"Python Pool","url":"https:\/\/www.pythonpool.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","width":452,"height":185,"caption":"Python Pool"},"image":{"@id":"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/pythonpool","https:\/\/www.youtube.com\/c\/pythonpool"]},{"@type":"Person","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/294338f378f0853e6af4ca4a5a907ea6","name":"Namrata Gulati","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/19c5e6bfbc6202d4017b79f726b2ad5e520491d67ff428a87c071afef23ecd89?s=96&d=wavatar&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/19c5e6bfbc6202d4017b79f726b2ad5e520491d67ff428a87c071afef23ecd89?s=96&d=wavatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/19c5e6bfbc6202d4017b79f726b2ad5e520491d67ff428a87c071afef23ecd89?s=96&d=wavatar&r=g","caption":"Namrata Gulati"}}]}},"_links":{"self":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/28066","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/users\/38"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/comments?post=28066"}],"version-history":[{"count":76,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/28066\/revisions"}],"predecessor-version":[{"id":42003,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/28066\/revisions\/42003"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media\/32391"}],"wp:attachment":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media?parent=28066"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/categories?post=28066"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/tags?post=28066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}