 <p>Are you using Python 2? If so, <code>print</code> is a keyword, not a function. There are two ways to solve your problem:</p> <ol> <li><p>Write <code>print foo, bar</code> instead of <code>print(foo, bar)</code>.</p> <p>The difference is that <code>print(foo, bar)</code> is actually printing out the <em>tuple</em> <code>(foo, bar)</code>, which uses the <code>repr()</code> representation of each element, rather than its <code>str()</code>.</p></li> <li><p>At the very top of your file, write <code>from __future__ import print_function</code>. This will magically convert <code>print</code> from a keyword into a function, causing your code to work as expected.</p></li> </ol> <p>If you <em>are</em> using Python 3, my answer is irrelevant.</p>