初學Python的學習筆記9----面向對象編程(獲取對象信息、實例屬性和類屬性)、面向對象高級編程(使用__slots__、使用@property)...

2019獨角獸企業重金招聘Python工程師標準>>> 編程 1.獲取對象信息 (1)使用type():判斷對象類型,返回對應的class類型 print type(123) # int print type('yj') # 字符串 print type(True) # 布爾值 print type(None) print type(abs) # 函數 #輸出信息 <type 'i
相關文章
相關標籤/搜索