Complete the function/method so that it returns the url with anything after the anchor (#) removed.
My code:
def remove_url_anchor(url):
new_url = []
for char in url:
if char != "#":
new_url.append(char)
else:
break
result = "".join(new_url)
return result
def remove_url_anchor(url):
return url.split('#')[0]