how to remove blank spaces in a string in python code example Example: python delete white spaces sentence = ' hello apple' sentence.strip() >>> 'hello apple'