|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
区分字符串中的字符
1.islower()
含有字符且都是小写字符,返回ture,否则返回false
例如
- >>> str1='123456789'
- >>> str1.islower()
- False
- >>> str1='abc546'
- >>> str1.islower()
- True
复制代码
2.sinumeric()
只含有数字
例如
- >>> str1='123456789'
- >>> str1.islower()
- False
- >>> str1='abc546'
- >>> str1.islower()
- True
复制代码
3.isspace
- [/code]
- 只包含空格
- [code]>>> str1=' '
- >>> str1.isspace()
- True
复制代码
4.istitle()
所有单词开头大写,其余小写,返回ture
例如
- >>> str1='Hello Word'
- >>> str1.istitle()
- True
复制代码
issupper()
有字符且均为大写,返回ture
例如
- >>> str1='AED'
- >>> str1.isupper()
- True
复制代码
|
评分
-
查看全部评分
|