LoginSignup
0
0

isalpha()

Posted at

isalpha()とは

isalphaとはpythonの文字列メソッドの1つで、文字列が全てアルファベットで構成されているかどうかをチェックします。
以下に例を示します。

sample.py
s = "HelloWorld"
print(s.isalpha())  # 出力: True

s = "Hello World"
print(s.isalpha())  # 出力: False

この例では、最初の文字列"HelloWorld"は全てアルファベットで構成されているため、s.isalpha()はTrueを返します。一方、二つ目の文字列"Hello World"はスペースが含まれるため、s.isalpha()はFalseを返します。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0