title: Terminal printing results at another location?
body: <p>Everyone. I am a beginner programmer, and I can't seem to find this information anywhere on the web, so I am hoping you guys can help. My problem is that sometimes when I try to print a result the terminal spits back something like "" or "", rather than the result. I am actually following very short, very simple lines of code straight out of a book and still getting these results. </p>
  
  <p>Here are some examples to better show what is happening.</p>
  
  <p>In the first example, "potato" is just the file handle name of a random text document.</p>
  
  <pre><code>import nltk
  def diversity(potato):
      return len(potato) / len(set(potato))
  print diversity(potato)
  #prints &lt;function diversity at 0x107b5a848&gt;"&gt;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>import nltk
  print bigrams(['make', 'me', 'some', 'bigrams'])
  #prints &lt;generator object bigram at 0x1088a4d20&gt; 
  </code></pre>
  
  <p>However in the examples in the text book just show the correct results printing. If it is at all important to know, I am specifically working with the book "Natural Language Processing with Python" by Bird, Klein, and Loper, and I am running Python 2.7.9.</p>
  
  <p>Can anyone explain what is happening and how I can get around this? These are very simple lines of code with very simple answers, so the fact that my terminal seemingly refuses to print the correct answers is irritating and worrisome. Thank you! </p>