python remove the spaces from a string code example Example: python delete white spaces sentence = ' hello apple' sentence.strip() >>> 'hello apple'