python判断字符串是字母 数字 大小写

python判断字符串是字母 数字 大小写

学习了:https://blog.csdn.net/liulirong1995/article/details/78349288?locationNum=8&fps=1

字符串.isalnum()  所有字符都是数字或者字母,为真返回 Ture,否则返回 False。

字符串.isalpha()   所有字符都是字母,为真返回 Ture,否则返回 False。

字符串.isdigit()     所有字符都是数字,为真返回 Ture,否则返回 False。

字符串.islower()    所有字符都是小写,为真返回 Ture,否则返回 False。

字符串.isupper()   所有字符都是大写,为真返回 Ture,否则返回 False。

字符串.istitle()      所有单词都是首字母大写,为真返回 Ture,否则返回 False。

字符串.isspace()   所有字符都是空白字符,为真返回 Ture,否则返回 False。

猜你喜欢

转载自www.cnblogs.com/stono/p/9102043.html