Always return proper URL no matter what the user enters?
<p>I have the following python code
<pre><code>from urlparse import urlparse</p>

<p>def clean_url(url):
    new_url = urlparse(url)
    if new_url.netloc == '':
        return new_url.path.strip().decode()
    else:
        return new_url.netloc.strip().decode()</p>

<p>print clean_url("http://www.facebook.com/john.doe")
print clean_url("http://facebook.com/john.doe")
print clean_url("facebook.com/john.doe")
print clean_url("www.facebook.com/john.doe")
print clean_url("john.doe")
</pre></code>
In each example I take in a string and return it. This is not what I want. I am trying to take each example and always return "http://www.facebook.com/john.doe" even if they just type www.* or just john.doe.</p>

<p>I am fairly new to programming so please be gentle.</p>
