remove blank spaces in python string program code example Example: python remove spaces string=' t e s t ' print(string.replace(' ',''))