判断类型 isinstance() a = [1, 2, 3] print isinstance(a, list) True 查看类型 type() a = [1, 2, 3] type(a) <type 'list'>