python 判断类型
2017-04-06 本文已影响0人
AfterlifeYeah
判断类型 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'>