【Python开发】查看数据类型
2024-09-05 13:07:04
import types aaa = 0
print type(aaa)
if type(aaa) is types.IntType:
print "the type of aaa is int"
if isinstance(aaa,int):
print "the type of aaa is int" bbb = 'hello'
print type(bbb)
if type(bbb) is types.StringType:
print "the type of bbb is string"
if isinstance(bbb,str):
print "the type of bbb is string" #if the type is NoneType,the isinstance does not work
#we should judge the NoneType like below
#if row is None
#if type(row) is types.NoneType #In my opinion,use the types to judge the type of a param is convinient
最新文章
- ffmpeg-20160816-bin.7z
- STL_advance distance prev next
- viewport的一些事
- Creating Directives that Communicate
- RobotFramework 安装配置(二)
- OA,ERP等源码一部分演示
- 迭代器(iterator) 与 traits 编程技法
- MYSQL-用户权限的验证过程(转)
- 学习Redux之分析Redux核心代码分析
- poj 3694双联通缩点+LCA
- 封装一个button上带图片的,图片在上,文字在下的按钮
- ORM之SQLALchemy
- create-react-app:reject和不reject(使用react-app-rewired)这2种情况下的antd组件按需引入配置
- 写了一个兼容IE9的图片放大器(基于vue)
- Windows下安装Python及Eclipse中配置PyDev插件
- Mysql命令insert into:向表中插入数据(记录)
- Css 特性之 transition和transform
- KVM halt-polling机制分析
- windows下git bash中文乱码解决办法
- eclipse下properties配置文件中文乱码解决