title: Python 'print' method always prints in the same cell, doesn't matter in what cell it is called
body: <p>I have a <em>jupyter</em> notebook that calls a method <code>compare_sizes()</code> that prints some lines when executed. The problem that I am having is that these lines are printed in a different cell that the one where the method is called from:</p>
  <p><a href="https://i.stack.imgur.com/ugTKw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ugTKw.png" alt="enter image description here" /></a></p>
  <p>As you can see, the method is called from cell 22, but the lines are printed in cell 19. I tried restoring the kernel, but I get the same result. I have used this method in other notebooks with good results.</p>
  <p><strong>EDIT</strong></p>
  <p>I discovered that EVERYTHING I print is printed in cell 19.</p>