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