stripメソッドでは、文字列の最初と最後の空白を削除することができます。
stripメソッド

図のように頭・最後・文中に空白のある文字列があるものとします。
#python
文字列 = (" a b c ")
print(文字列.strip())
この文字列に対し、stripメソッドを噛ませて出力すると、

最初と最後の空白だけが削除されます。文字と文字の間の空白はそのまま維持されます。

Python操作方法、関数・メソッドリファレンス
使用用途別にまとめたPythonリファレンスページです。
初期準備、基本概念
ダウンロード、インストール、起動
ShellとEditor、保存、実行
保存したPythonの起動
コメント、docstring、行またぎ
コメント、...
コメント