title: Generate bigrams with NLTK
body: <p>I am trying to produce a bigram list of a given sentence for example, if I type,</p>
  
  <pre><code>    To be or not to be
  </code></pre>
  
  <p>I want the program to generate </p>
  
  <pre><code>     to be, be or, or not, not to, to be
  </code></pre>
  
  <p>I tried the following code but just gives me         </p>
  
  <pre><code>&lt;generator object bigrams at 0x0000000009231360&gt;
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>    import nltk
      bigrm = nltk.bigrams(text)
      print(bigrm)
  </code></pre>
  
  <p>So how do I get what I want? I want a list of combinations of the words like above (to be, be or, or not, not to, to be).</p>