title: str() vs repr() functions in python 2.7.5
body: <p>what is the difference between <code>str()</code> and <code>repr()</code> functions in python 2.7.5?</p>
  
  <p>Explanation on python.org:</p>
  
  <blockquote>
    <p>The <code>str()</code> function is meant to return representations of values which are fairly <strong>human-readable</strong>, while <code>repr()</code> is meant to generate 
    representations which can be <strong>read by the interpreter</strong> (or will force a <code>SyntaxError</code> if there is no equivalent syntax)</p>
  </blockquote>
  
  <p>But it wasn't clear for me.</p>
  
  <p>some examples:</p>
  
  <pre><code>&gt;&gt;&gt; s = 'Hello, world.'
  &gt;&gt;&gt; str(s)
  'Hello, world.'
  &gt;&gt;&gt; repr(s)
  "'Hello, world.'"      # repr is giving an extra double quotes
  &gt;&gt;&gt; str(1.0/7.0)
  '0.142857142857'
  &gt;&gt;&gt; repr(1.0/7.0)
  '0.14285714285714285'  # repr is giving value with more precision
  </code></pre>
  
  <p>so I want to know the following</p>
  
  <ol>
  <li>When should I use <code>str()</code> and when should I use <code>repr()</code>?</li>
  <li>In which cases I can use either of them?</li>
  <li>What can <code>str()</code> do which <code>repr()</code> can't?</li>
  <li>What can <code>repr()</code> do which <code>str()</code> can't?</li>
  </ol>