python remove space in the end code example Example: python remove space from end of string >>> " xyz ".rstrip() ' xyz'