Run
# Given string x = " hello world " # Strip whitespaces on right side of string x_stripped = x.rstrip() print(f"Original : \"{x}\"") print(f"Right Stripped : \"{x_stripped}\"")
Output