Turn an article title into a URL slug: lowercase it, replace every run of characters that are not ASCII letters or digits with a single hyphen, and remove hyphens at the start and end.
Implement slugify. Input: title: str. Returns: str.
def slugify(title: str) -> str:
return title
Run executes the public tests. Submit grades against public and hidden tests.
Turn an article title into a URL slug: lowercase it, replace every run of characters that are not ASCII letters or digits with a single hyphen, and remove hyphens at the start and end.
Implement slugify. Input: title: str. Returns: str.
def slugify(title: str) -> str:
return title
Run executes the public tests. Submit grades against public and hidden tests.