title: Printing generator objects in python
body: <p>I created my own iterator (to learn how they work) as follows</p>
  
  <pre><code>class Reverse():
      def __init__(self, word):
          self.word = word
          self.index = len(word)
      def __iter__(self):
          return self
      def __next__(self):
          self.index -=1
          if self.index &lt; 0:
              raise StopIteration
          return self.word[self.index]
  
  print (char for char in Reverse("word"),end="")
  </code></pre>
  
  <p>I know I can say:</p>
  
  <pre><code>rev = Reverse("word")
  for char in rev:
      print(char, end="")
  </code></pre>
  
  <p>but I was hoping to be able to do it in a single line</p>
  
  <pre><code>print (char for char in Reverse("word"),end="")
  </code></pre>
  
  <p>This doesn't work and raises an error. If I remove the <code>end=""</code> it prints out a <code>generator object</code>. Surely by including a <code>for loop</code> in the <code>print</code> statement it should iterate through my generator object and print each item? 
  Why does this not happen</p>