type()
返回参数的类型。class 'xxx'
isinstance()
返回布尔型,两个参数类型一直,返回true,否则返回false
>>>isinstance(320,int)
True
>>>a='Cytosine'
>>>isinstance(a,str)
True
>>>isinstance(a,int)
False
type()
返回参数的类型。class 'xxx'
isinstance()
返回布尔型,两个参数类型一直,返回true,否则返回false
>>>isinstance(320,int)
True
>>>a='Cytosine'
>>>isinstance(a,str)
True
>>>isinstance(a,int)
False