Run
# Given string x = " hello world " # Strip whitespaces x_stripped = x.strip() print(f"Original : \"{x}\"") print(f"Stripped : \"{x_stripped}\"")
Output