normalize_whitespace(s) that collapses every run of internal whitespace (spaces, tabs) down to a single space, and also trims leading/trailing whitespace.s = ' Hello World '
'Hello World'
Leading/trailing spaces trimmed, internal double-space collapsed to one.
s = 'This is a test'
'This is a test'
Every internal whitespace run becomes exactly one space.
`s.split()` with no arguments already tokenizes on any whitespace run, discarding empties.
Rejoin the tokens with a single space.