小册名称:Python合辑2-字符串常用方法
4、rstrip()
移除字符串右侧指定的字符(默认为空格或换行符)或字符序列。
s = ' hello '.rstrip()print(s)# hello
s = ' hello '.rstrip()
print(s)
# hello