title: Python String Formatting And String Multiplication Oddity
body: <p>Python is doing string multiplication where I would expect it to do numeric multiplication, and I don't know why.</p>
  
  <pre><code>&gt;&gt;&gt; print('%d' % 2 * 4)
  2222
  &gt;&gt;&gt; print('%d' % (2 * 4))
  8
  </code></pre>
  
  <p>Even forcing the type to integer does nothing. (I realize this is redundant, but it's an idiot-check for me:</p>
  
  <pre><code> &gt;&gt;&gt; print('%d' % int(2) * int(4))
   2222
  </code></pre>
  
  <p>Obviously I solved my problem (adding the parenthesis does it) but what's going on here? If this is just a quirk I have to remember, that's fine, but I'd rather understand the logic behind this.</p>