Try this :
s = " Swarnendu Pal is a good boy " s.replace(" ", "")
this will effectively remove any space