isspace

毎日Python/こつこつPython

【毎日Python】Pythonで文字列が空白かどうか確認する方法|str.isspace

str = ' ' str.isspace() True pythonで文字列が空であるかどうかを確認する方法です。python標準ライブラリのisspaceメソッドを使用します。文字列の中が空であればTrueを文字や記号などが入っていたら...