lstrip
rstrip
split
末尾の空白(または指定した文字)を除去します。
str.rstrip(chars?)
下記の値を入力するとサンプルに即時反映されます。
print
text = " hello world " print(text.rstrip()) # " hello world"