title: Python: avoid new line with print command
body: <p>When I use the <code>print</code> command, it prints whatever I want and then goes to a different line. For example:</p>
  <pre><code>print &quot;this should be&quot;; print &quot;on the same line&quot;
  </code></pre>
  <p>Should return:</p>
  <blockquote>
  <p>this should be on the same line</p>
  </blockquote>
  <p>but instead returns:</p>
  <blockquote>
  <p>this should be<br />
  on the same line</p>
  </blockquote>
  <p>More precisely I was trying to create a program with <code>if</code> that told me whether a number was a 2 or not</p>
  <pre><code>def test2(x):
      if x == 2:
          print &quot;Yeah bro, that's tottaly a two&quot;
      else:
          print &quot;Nope, that is not a two. That is a (x)&quot;
  </code></pre>
  <p>But it doesn't recognise the last <code>(x)</code> as the value entered, and rather prints exactly: &quot;(x)&quot; (the letter with the brackets). To make it work I have to write:</p>
  <pre><code>print &quot;Nope, that is not a two. That is a&quot;; print (x)
  </code></pre>
  <p>And if e.g. I enter <code>test2(3)</code> that gives:</p>
  <blockquote>
  <p>Nope, that is not a two, that is a<br />
  3</p>
  </blockquote>
  <p>So either I need to make Python recognise my (x) inside a print line as the number; or to print two separate things but on the same line.</p>
  <p><strong>IMPORTANT NOTE</strong>: I am using <strong>version 2.5.4</strong></p>
  <p>Another note: If I put <code>print &quot;Thing&quot; , print &quot;Thing2&quot;</code> it says &quot;Syntax error&quot; on the 2nd print.</p>