Python 字符串方法
檢查文本中的所有字符是否都是字母:
txt = "CompanyX" x = txt.isalpha() print(x)
運行實例
如果所有字符都是字母(a-z),則 isalpha() 方法將返回 True。
非字母的字符例子:(space)!#%&? 等等。
string.isalpha()
無參數.
txt = "Company10" x = txt.isalpha() print(x)