{"id":2352,"date":"2020-01-01T15:30:41","date_gmt":"2020-01-01T10:00:41","guid":{"rendered":"http:\/\/www.pythonpool.com\/?p=2352"},"modified":"2021-06-14T15:57:01","modified_gmt":"2021-06-14T10:27:01","slug":"python-print-without-newline","status":"publish","type":"post","link":"https:\/\/www.pythonpool.com\/python-print-without-newline\/","title":{"rendered":"Python Print Without Newline [How to, Examples, Tutorial]"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_74 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\/python-print-without-newline\/#Problem\" >Problem<\/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\/python-print-without-newline\/#Python_print_function\" >Python print() function<\/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\/python-print-without-newline\/#Python_print_without_newline_in_Python3\" >Python print without newline in Python3<\/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\/python-print-without-newline\/#Explanation_Using_end_Parameter\" >Explanation Using end Parameter<\/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\/python-print-without-newline\/#Python_print_without_newline_in_Python2\" >Python print without newline in Python2<\/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\/python-print-without-newline\/#Python_print_without_newline_using_the_inbuilt_library\" >Python print without newline using the inbuilt library<\/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\/python-print-without-newline\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Problem\"><\/span>Problem<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In <strong>Python<\/strong> programming language, by default <strong>print<\/strong> statement adds a <strong>newline<\/strong> character. So when we have multiple print statements the <strong>output<\/strong> from each of them is <strong>printed<\/strong> in multiple lines as you can see in the example below. Our goal is to print them in a <strong>single line<\/strong> or <strong>python print without newline <\/strong>and use some special parameters to the print function to achieve that. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Python_print_function\"><\/span>Python print() function<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To print the data, we use the print function. It is very easy to use. Let\u2019s have a look at one example of the print function.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nprint(&quot;first line&quot;)\nprint(&quot;second line&quot;)\nprint&quot;third line&quot;)\n<\/pre><\/div>\n\n\n<p> <strong>The output is: <\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfirst line\nseconde line\nthird line\n<\/pre><\/div>\n\n\n<p>We have to pass the data that we wish to print in the print function. It is this easy to<strong> print<\/strong> <strong>data in python<\/strong>. But observe the output of the above python code. We used <strong>three print functions<\/strong> and each value is <strong>printed in a different line.<\/strong> There is no problem with it but sometimes we want that data should be printed on the <strong>same line<\/strong>.<\/p>\n\n\n\n<p>However, In some cases, we may want to output multiple strings on the <strong>same line<\/strong> using separate&nbsp;<code>print<\/code>&nbsp;statements. There are a few ways to prevent Python from adding the newline character when using the&nbsp;<code>print<\/code>&nbsp;function, depending on whether we are using <a href=\"https:\/\/www.python.org\/downloads\/release\/python-272\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"Python 2.x (opens in a new tab)\">Python 2.x<\/a> or Python 3.x. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Python_print_without_newline_in_Python3\"><\/span>Python print without newline in Python3<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In Python 3,<strong>&nbsp;print()<\/strong>&nbsp;is a function that prints output on different lines, every time you use the function. <strong>Python 3<\/strong> provides the simplest solution, all you have to do is to provide one<strong> extra argument<\/strong> to the <strong>print<\/strong> function. <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n# use the argument &quot;end&quot; to specify the end of line string\n\nprint(&quot;Good Morning!&quot;, end = '')\nprint(&quot;Have a wonderful day!&quot;)\n<\/pre><\/div>\n\n\n<p><strong>Output<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Good Morning!Have a wonderful day!<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Explanation_Using_end_Parameter\"><\/span>Explanation Using end Parameter<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here we are using the <strong>end<\/strong> parameter to use a specific character at the end of the output from each print statement. In the above example, we used &#8220;,&#8221; as a special character with the <strong>end parameter<\/strong>, which will appear at the <strong>end<\/strong> of the output of each print statement. The result will not be <strong>printed in multiple lines.<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-vivid-purple-color\"><strong>Must Read:<\/strong> <a href=\"http:\/\/www.pythonpool.com\/python-null\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"Python Null (opens in a new tab)\">Python Null<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Python_print_without_newline_in_Python2\"><\/span>Python print without newline in Python2<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p> Unlike Python 3, Python 2 does&nbsp;not have the<strong>&nbsp;&#8216;end&#8217;<\/strong>&nbsp;function. For the <strong>python version 2.0<\/strong> and above, we have to use a different approach. Instead of using the end keyword, We can simply separate the print function by a comma to <strong>print without a newline. <\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n# no newlines but a space will be printed out\nprint &quot;Hello World!&quot;,\nprint &quot;This is Daniel from Python Pool&quot;\n<\/pre><\/div>\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nHello World! This is Daliel from Python Pool\n<\/pre><\/div>\n\n\n<p>As you can see, even though there were no newlines, we still got a space character between the two print statements.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Python_print_without_newline_using_the_inbuilt_library\"><\/span>Python print without newline using the inbuilt library<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To<strong> print without a newline in python, <\/strong>there is another method. In this, you can use the powerful&nbsp;sys.stdout.write&nbsp;a function from the&nbsp;sys module.<\/p>\n\n\n\n<p>The Benefits of using inbuilt-library are:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The function will only print whatever you explicitly tell it to print.<\/li><li> There are no terminating strings. <\/li><\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n&lt;pre class=&quot;wp-block-syntaxhighlighter-code&quot;&gt;#Import the inbuilt sys library\nimport sys\n#First Line of output\nsys.stdout.write(&quot;Hey! Welcome to &lt;a href=&quot;http:\/\/www.pythonpool.com\/&quot; target=&quot;_blank&quot; rel=&quot;noreferrer noopener&quot;&gt;Python Pool&lt;\/a&gt;.&quot;)\n#Second Line of output\nsys.stdout.write(&quot;We have the best python tutorials&quot;)&lt;\/pre&gt;\n<\/pre><\/div>\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n&lt;pre class=&quot;wp-block-syntaxhighlighter-code&quot;&gt;Hey! Welcome to &lt;a href=&quot;http:\/\/www.pythonpool.com\/&quot; target=&quot;_blank&quot; rel=&quot;noreferrer noopener&quot;&gt;Python Pool&lt;\/a&gt;.We have the best python tutorials&lt;\/pre&gt;\n<\/pre><\/div>\n\n\n<p><strong>Note:&nbsp;<\/strong>The output of both the example above will be in one line&nbsp;without adding space in between the strings. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"448\" height=\"271\" src=\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/01\/pexels-photo-356079.jpeg\" alt=\"python print without a newline\" class=\"wp-image-2361\" srcset=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/01\/pexels-photo-356079.jpeg 448w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/01\/pexels-photo-356079-300x181.jpeg 300w\" sizes=\"(max-width: 448px) 100vw, 448px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>For <strong>Python print without newline<\/strong> In <strong>Python 3,<\/strong> you can use the named&nbsp;<strong>end&nbsp;<\/strong>argument in the print function and assign an empty string to this argument to prevent the terminating newline.<\/p>\n\n\n\n<p><a href=\"http:\/\/www.pythonpool.com\/python-remove-newline-from-list\/\" target=\"_blank\" rel=\"noopener\"><\/a>For <strong>Python print without newline<\/strong> In <strong>Python 2<\/strong>, you can either use a comma after your print statement if you don\u2019t mind the space.<\/p>\n\n\n\n<p>or you can just use the&nbsp;<strong>sys.stdout.write()<\/strong>&nbsp;function.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p> I<em>f you didn\u2019t find what you were looking, then do suggest us in the comments below. We will be more than happy to add that.<\/em> <\/p><cite>Team <a href=\"http:\/\/www.pythonpool.com\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"Python Pool (opens in a new tab)\">Python Pool<\/a><\/cite><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Problem In Python programming language, by default print statement adds a newline character. So when we have multiple print statements the output from each of &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Python Print Without Newline [How to, Examples, Tutorial]\" class=\"read-more button\" href=\"https:\/\/www.pythonpool.com\/python-print-without-newline\/#more-2352\" aria-label=\"More on Python Print Without Newline [How to, Examples, Tutorial]\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":2360,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[15],"tags":[102,99,101,100,103,98],"class_list":["post-2352","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-how-to-print-without-newline-in-python","tag-print-without-newline-python","tag-python-2-7-print-without-newline","tag-python-3-print-without-newline","tag-python-how-to-print-without-newline","tag-python-print-without-newline","infinite-scroll-item"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.1 (Yoast SEO v25.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python Print Without Newline [How to, Examples, Tutorial] - Python Pool<\/title>\n<meta name=\"description\" content=\"Printing without a newline in Python 2 &amp; 3 is very easy and straight forward. To python print without a newline in Python 3 use the end argument\" \/>\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\/python-print-without-newline\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Print Without Newline [How to, Examples, Tutorial]\" \/>\n<meta property=\"og:description\" content=\"Problem In Python programming language, by default print statement adds a newline character. So when we have multiple print statements the output from\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pythonpool.com\/python-print-without-newline\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Pool\" \/>\n<meta property=\"article:published_time\" content=\"2020-01-01T10:00:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-06-14T10:27:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/01\/Capture.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1017\" \/>\n\t<meta property=\"og:image:height\" content=\"615\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Python Pool\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\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=\"Python Pool\" \/>\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\/python-print-without-newline\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-print-without-newline\/\"},\"author\":{\"name\":\"Python Pool\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/f87448ee54c0ffd2889fbf2408c18998\"},\"headline\":\"Python Print Without Newline [How to, Examples, Tutorial]\",\"datePublished\":\"2020-01-01T10:00:41+00:00\",\"dateModified\":\"2021-06-14T10:27:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-print-without-newline\/\"},\"wordCount\":593,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-print-without-newline\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/01\/Capture.jpg\",\"keywords\":[\"how to print without newline in python\",\"print without newline python\",\"python 2.7 print without newline\",\"python 3 print without newline\",\"python how to print without newline\",\"python print without newline\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.pythonpool.com\/python-print-without-newline\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pythonpool.com\/python-print-without-newline\/\",\"url\":\"https:\/\/www.pythonpool.com\/python-print-without-newline\/\",\"name\":\"Python Print Without Newline [How to, Examples, Tutorial] - Python Pool\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-print-without-newline\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-print-without-newline\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/01\/Capture.jpg\",\"datePublished\":\"2020-01-01T10:00:41+00:00\",\"dateModified\":\"2021-06-14T10:27:01+00:00\",\"description\":\"Printing without a newline in Python 2 & 3 is very easy and straight forward. To python print without a newline in Python 3 use the end argument\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-print-without-newline\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pythonpool.com\/python-print-without-newline\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/python-print-without-newline\/#primaryimage\",\"url\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/01\/Capture.jpg\",\"contentUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/01\/Capture.jpg\",\"width\":1017,\"height\":615,\"caption\":\"how to print without newline in python\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pythonpool.com\/python-print-without-newline\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pythonpool.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python Print Without Newline [How to, Examples, Tutorial]\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pythonpool.com\/#website\",\"url\":\"https:\/\/www.pythonpool.com\/\",\"name\":\"Python Pool\",\"description\":\"Your One-Stop Python Learning Destination\",\"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\":\"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"contentUrl\":\"http:\/\/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\/f87448ee54c0ffd2889fbf2408c18998\",\"name\":\"Python Pool\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/fdd3cb9ad7f560324dfd481989550aa8ffce84388fd253c42beca35c999d3108?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/fdd3cb9ad7f560324dfd481989550aa8ffce84388fd253c42beca35c999d3108?s=96&d=wavatar&r=g\",\"caption\":\"Python Pool\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Python Print Without Newline [How to, Examples, Tutorial] - Python Pool","description":"Printing without a newline in Python 2 & 3 is very easy and straight forward. To python print without a newline in Python 3 use the end argument","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\/python-print-without-newline\/","og_locale":"en_US","og_type":"article","og_title":"Python Print Without Newline [How to, Examples, Tutorial]","og_description":"Problem In Python programming language, by default print statement adds a newline character. So when we have multiple print statements the output from","og_url":"https:\/\/www.pythonpool.com\/python-print-without-newline\/","og_site_name":"Python Pool","article_published_time":"2020-01-01T10:00:41+00:00","article_modified_time":"2021-06-14T10:27:01+00:00","og_image":[{"width":1017,"height":615,"url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/01\/Capture.jpg","type":"image\/jpeg"}],"author":"Python Pool","twitter_card":"summary_large_image","twitter_creator":"@pythonpool","twitter_site":"@pythonpool","twitter_misc":{"Written by":"Python Pool","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pythonpool.com\/python-print-without-newline\/#article","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/python-print-without-newline\/"},"author":{"name":"Python Pool","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/f87448ee54c0ffd2889fbf2408c18998"},"headline":"Python Print Without Newline [How to, Examples, Tutorial]","datePublished":"2020-01-01T10:00:41+00:00","dateModified":"2021-06-14T10:27:01+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pythonpool.com\/python-print-without-newline\/"},"wordCount":593,"commentCount":0,"publisher":{"@id":"https:\/\/www.pythonpool.com\/#organization"},"image":{"@id":"https:\/\/www.pythonpool.com\/python-print-without-newline\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/01\/Capture.jpg","keywords":["how to print without newline in python","print without newline python","python 2.7 print without newline","python 3 print without newline","python how to print without newline","python print without newline"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pythonpool.com\/python-print-without-newline\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pythonpool.com\/python-print-without-newline\/","url":"https:\/\/www.pythonpool.com\/python-print-without-newline\/","name":"Python Print Without Newline [How to, Examples, Tutorial] - Python Pool","isPartOf":{"@id":"https:\/\/www.pythonpool.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pythonpool.com\/python-print-without-newline\/#primaryimage"},"image":{"@id":"https:\/\/www.pythonpool.com\/python-print-without-newline\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/01\/Capture.jpg","datePublished":"2020-01-01T10:00:41+00:00","dateModified":"2021-06-14T10:27:01+00:00","description":"Printing without a newline in Python 2 & 3 is very easy and straight forward. To python print without a newline in Python 3 use the end argument","breadcrumb":{"@id":"https:\/\/www.pythonpool.com\/python-print-without-newline\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pythonpool.com\/python-print-without-newline\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/python-print-without-newline\/#primaryimage","url":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/01\/Capture.jpg","contentUrl":"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/01\/Capture.jpg","width":1017,"height":615,"caption":"how to print without newline in python"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pythonpool.com\/python-print-without-newline\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pythonpool.com\/"},{"@type":"ListItem","position":2,"name":"Python Print Without Newline [How to, Examples, Tutorial]"}]},{"@type":"WebSite","@id":"https:\/\/www.pythonpool.com\/#website","url":"https:\/\/www.pythonpool.com\/","name":"Python Pool","description":"Your One-Stop Python Learning Destination","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":"http:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","contentUrl":"http:\/\/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\/f87448ee54c0ffd2889fbf2408c18998","name":"Python Pool","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/fdd3cb9ad7f560324dfd481989550aa8ffce84388fd253c42beca35c999d3108?s=96&d=wavatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fdd3cb9ad7f560324dfd481989550aa8ffce84388fd253c42beca35c999d3108?s=96&d=wavatar&r=g","caption":"Python Pool"}}]}},"_links":{"self":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/2352","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/comments?post=2352"}],"version-history":[{"count":5,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/2352\/revisions"}],"predecessor-version":[{"id":24428,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/2352\/revisions\/24428"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media\/2360"}],"wp:attachment":[{"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media?parent=2352"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/categories?post=2352"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/tags?post=2352"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}