title: Python - Store replace function in a method
body: <p>I'm trying to store the replace function in a method to make it easier to read and work with.</p>
  
  <p>Basically instead of doing <code>str.replace(string, ' ', '_').lower()</code> I'd prefer doing <code>replaceandlower(string)</code>. I'm doing this to format a title to a slug (like "How's the weather today" becomes --> "hows_the_weather_today").</p>
  
  <p>At this moment I have:</p>
  
  <pre><code>def replaceandlower(string):
    str.replace(string, ' ', '-').lower()
  </code></pre>
  
  <p>I thought that the following would work but it returns a <code>None</code> object type:</p>
  
  <pre><code>url = replaceandlower(title)
  </code></pre>
  
  <p>What I'm doing wrong?</p>