Remova os caracteres espaciais da string em python
>>> " hello apple ".replace(" ", "")
'helloapple'
Tan MH
>>> " hello apple ".replace(" ", "")
'helloapple'