Created
January 26, 2016 06:19
-
-
Save FindHao/e4bb97954b985d277ab5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s为字符串 | |
s.isalnum() 所有字符都是数字或者字母 | |
s.isalpha() 所有字符都是字母 | |
s.isdigit() 所有字符都是数字 | |
s.islower() 所有字符都是小写 | |
s.isupper() 所有字符都是大写 | |
s.istitle() 所有单词都是首字母大写,像标题 | |
s.isspace() 所有字符都是空白字符、 、、 | |
判断是整数还是浮点数 | |
a=123 | |
b=123.123 | |
>>>isinstance(a,int) | |
True | |
>>>isinstance(b,float) | |
True | |
>>>isinstance(b,int) | |
False | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment