Python print_r which returns value instead of printing it
<p>Is it possible, in Python, to do something similar to:</p>

<pre><code>echo 'Content of $var is ', print_r($var, TRUE);
</code></pre>

<p>in PHP?</p>

<p>I have a variable var and I would like to assign its contents in a readable form to a string, for example:</p>

<pre><code>str = 'Hello. '
str = str + var
</code></pre>
