python 数据类型

str为字符串
str.isalnum() 所有字符都是数字或者字母
str.isalpha() 所有字符都是字母
str.isdigit() 所有字符都是数字
str.islower() 所有字符都是小写
str.isupper() 所有字符都是大写
str.istitle() 所有单词都是首字母大写,像标题
str.isspace() 所有字符都是空白字符、\t、\n、\r

 

判断是否为数字类型:isinstance(1, (int, long, float))

is_integer:判断是否为浮点数类型的整数,比如:2.0

round() 方法返回浮点数x的四舍五入值:

round( x [, n]  )

强制类型转换参考:http://blog.csdn.net/jmilk/article/details/49720611
posted @ 2017-04-20 16:05  菱花淚硃砂  阅读(143)  评论(0编辑  收藏  举报