判断类型 isinstance()
a = [1, 2, 3]
print isinstance(a, list)
True
查看类型 type()
a = [1, 2, 3]
type(a)
<type 'list'>
a = [1, 2, 3]
print isinstance(a, list)
True
a = [1, 2, 3]
type(a)
<type 'list'>
本文标题:python 判断类型
本文链接:https://www.haomeiwen.com/subject/tboqattx.html
网友评论