一:str.isalnum()str.isalpha()str.isdigit()str.islower()str.isupper()

1.str.isalnum() 
This method checks if all the characters of a string are alphanumeric (a-z, A-Z and 0-9).

>>> print 'ab123'.isalnum()
True
>>> print 'ab123#'.isalnum()
False

2.str.isalpha() 
This method checks if all the characters of a string are alphabetical (a-z and A-Z).

>>> print 'abcD'.isalpha()
True
>>> print 'abcd1'.isalpha()
False

3.str.isdigit() 
This method checks if all the characters of a string are digits (0-9).

>>> print '1234'.isdigit()
True
>>> print '123edsd'.isdigit()
False

4.str.islower() 
This method checks if all the characters of a string are lowercase characters (a-z)

>>> print 'abcd123#'.islower()
True
>>> print 'Abcd123#'.islower()
False

5.str.isupper()  

This method checks if all the characters of a string are uppercase characters (A-Z). 

>>> print 'ABCD123#'.isupper()
True
>>> print 'Abcd123#'.isupper()
False

  

  

  

最新文章

  1. css3过渡效果
  2. React Native填坑之旅--LayoutAnimation篇
  3. oracle11g数据库的安装以及安装之后的配置
  4. canvas-star6.html
  5. AJAX顺序输出
  6. Python遍历文件夹枚举所有文件类型
  7. javascript 用函数实现“继承”
  8. RHEL7重置root密码
  9. ajax例子
  10. [2015-10-11]常用git命令
  11. redis在Linux上的安装和简单使用
  12. 17_Android中Broadcast详解(有序广播,无序广播)最终广播,Bundle传递参数,传递参数的时候指定权限
  13. MySQL之路 ——2、步履维艰的建表
  14. webpack 中,module、chunk、bundle 的区别(待补充)
  15. Java 面试题 == 和 equals 的区别
  16. Ex3_15 判断图是否是一个强连通分量 判断点是否在汇点强连通分量中_十一次作业
  17. 【Python026--字典内键方法】
  18. Delphi FrieDAC 大数据处理
  19. java数组倒序查找值
  20. Gearman的使用

热门文章

  1. app Inventor
  2. loadrunner断言多结果返回
  3. EC20 R2.1
  4. 运行selenium脚本,报seleneium common exception.SessionNotCreatedException:Message:Unable to find a matching set of capabilities错误
  5. php操作excel表格的导入和导出
  6. Eclipse——在eclipse上安装Pydev插件实现python编程
  7. 内网环境上部署k8s+docker集群:集群ftp的yum源配置
  8. ES7的async/await
  9. Win2012 R2安装 sqlserver2017 Express
  10. error while loading shared libraries: libopencv_core.so.3.4: cannot open shared object file: No such file or directory