how to remove the space in a string python code example Example: python remove spaces string=' t e s t ' print(string.replace(' ',''))