且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何检查字符串中的字符是否是字母?蟒蛇

更新时间:2023-02-26 12:17:22

You can use isalpha(), see the docs at http://docs.python.org/2/library/stdtypes.html

An example:

>>> s = "a123b"
>>> for char in s:
...     print char, char.isalpha()
... 
a True
1 False
2 False
3 False
b True

相关阅读

技术问答最新文章