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