python判断类型:想知道一个对象(实例或者变量)是什么类型,什么结构的
摘要:
用type和isinstance 例子: ta={} ta['1']="a" ta={'2':"b"} ta['3']="c" #使用两个函数 if type(ta) is dict: print "what1" if isinstance(ta,dict): print "wh... 阅读全文
posted @ 2013-10-31 18:51 代码王子 阅读(239) 评论(0) 推荐(0)
浙公网安备 33010602011771号