remove space front and back from string python code example Example: python remove space from end of string >>> " xyz ".rstrip() ' xyz'