Lines are immutable. This means that none of their methods modifies the existing string - rather, they will return a new one to you. So, you need to assign the result back to a variable (same or different):
s = 'http://www.google.com'
s = s.replace("http://","")
print s
source
share