title: When to use %r instead of %s in Python?
body: <p>On <a href="http://learnpythonthehardway.org/">Learn Python the Hard Way</a> page 21, I see this code example:</p>
  
  <pre><code>x = "There are %d types of people." % 10
  ...
  print "I said: %r." % x
  </code></pre>
  
  <p>Why is <code>%r</code> used here instead of <code>%s</code>?  When would you use <code>%r</code>, and when would you use <code>%s</code>?</p>