Python Remova os espaços em branco da corda
sentence = ' hello apple '
sentence.strip()
>>> 'hello apple'
Blue-eyed Bear
sentence = ' hello apple '
sentence.strip()
>>> 'hello apple'
string = "Welcome to Python"
new_str = "".join(string.split(" "))
print(new_str) # "WelcometoPython"