title: Using yield in Python?
body: <p>I have this code:</p>
  
  <pre><code>def generator(n):
      list_of = range(1,n+1)
      for i in list_of:
          if i % 7 == 0:
              yield i
  
  print generator(100)
  </code></pre>
  
  <p>This should print all the numbers in the given range that are divisible by <code>7</code>, but the output is <code>&lt;generator object generator at 0x1004ad280&gt;</code> instead.</p>
  
  <p>Also, the word <code>yield</code> in my text editor (KOD) doesn't appear highlighted in sky blue color like all the reserved words but instead appears in white, is that fine?</p>