title: How to write inline if statement for print?
body: <p>I need to print some stuff only when a boolean variable is set to <code>True</code>. So, after looking at <a href="https://stackoverflow.com/questions/1319214/shorter-more-pythonic-way-of-writing-an-if-statements">this</a>, I tried with a simple example:</p>
  
  <pre><code>&gt;&gt;&gt; a = 100
  &gt;&gt;&gt; b = True
  &gt;&gt;&gt; print a if b
    File "&lt;stdin&gt;", line 1
      print a if b
               ^
  SyntaxError: invalid syntax  
  </code></pre>
  
  <p>Same thing if I write <code>print a if b==True</code>.</p>
  
  <p>What am I missing here?</p>