rejoin_with_dashes(s) that splits a sentence into words on whitespace and rejoins them using a single hyphen - as the separator, collapsing any run of extra spaces along the way.s = 'Data Vix rocks'
'Data-Vix-rocks'
Words joined with hyphens instead of spaces.
s = 'too many spaces'
'too-many-spaces'
Calling split() with no arguments collapses repeated whitespace.
`s.split()` with no arguments splits on any whitespace run and drops empty tokens.
Then `"-".join(words)`.