title: TypeError: not all arguments converted during string formatting in python script output
body: <p>I am attempting to learn python following using "Learn Python the Hard Way" 3rd edition and getting an error on exercise 8.</p>
  
  <p>I have python v 2.7.11 and using the following code</p>
  
  <pre><code>formatter = "%r %r %r $r"
  
  print formatter % (1, 2, 3, 4)
  print formatter % ("one", "two", "three", "four")
  print formatter % (True, False, False, True)
  print formatter % (formatter, formatter, formatter, formatter)
  print formatter % (
      "I had this thing.",
      "That you could type up right.",
      "But it didn't sing.",
      "So I said goodnight."
  )
  </code></pre>
  
  <p>when running python ex8.py, i get this error.</p>
  
  <pre><code>Traceback (most recent call last):
    File "ex8.py", line 3, in &lt;module&gt;
      print formatter % (1, 2, 3, 4)
  TypeError: not all arguments converted during string formatting
  </code></pre>
  
  <p>what could be the issue in this code? From what I see, this is exactly what is typed in the book, but I am getting the error.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Also, any other resources to help learn python would be appreciated.</p>