提供Python的字串移除前後空白範例
The strip() method removes any whitespace from the beginning or the end:
a = " Hello, World! "
print(a.strip()) # returns "Hello, World!"
Below is an instruction that describes a task. Write a response that appropriately completes the request. ### Instruction: 提供Python的字串移除前後空白範例 ### Response: The strip() method removes any whitespace from the beginning or the end:
a = " Hello, World! "
print(a.strip()) # returns "Hello, World!" 