return or print in __str__ method in python
<p>In the multiple choice question I'm stucked in, there are three options.
Here goes the question:</p>

<p>Which of the following is a definition of the _<em>str</em>_method?</p>

<pre><code>1. def __str__(self):
      print "(%s, %s, %s)" % (self._n, self._p, self._b)

2. def __str__(self):
      return "(%s, %s, %s)" % (self._n, self._p, self._b)

3. Both
</code></pre>

<p>I tested both of them, and both worked, but it is said that (2) is the answer.</p>

<p>The answers of all other similar questions also say that the function with 'print' is not the right one.</p>

<p>Is the answer wrong? </p>

<p>Thanks</p>
