Python中查看變量數據類型

內置函數isinstance(object, (type1,type2…)) isinstance('content', str) 返回True or Falseweb 使用內置函數type(object) print(type(1)) print(type('content')) 輸出bash <type 'int'> #返回整形 <type 'str'> #返回字符串
相關文章
相關標籤/搜索