SyntaxFix
Write A Post
Hire A Developer
Questions
Alternatively,
"strip my spaces".translate( None, string.whitespace )
And here is Python3 version:
"strip my spaces".translate(str.maketrans('', '', string.whitespace))