FunctionRacerProblemsRace

Make Slugs

EasypandasPython

posts has a column title. Turn each title into a slug: remove spaces at the start and end, make it lower case, then replace each space with a dash -. Titles have single spaces between words. Return the list of slugs in row order.

Example 1

posts {"title":["Hello World"," My First Post "]}
returns ["hello-world","my-first-post"]

hello-world and my-first-post.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More pandas problems