0X01;功能描述
type() 函數如果你只有第一個參數則返回對象的類型,三個參數返回新的類型對象。
0X02;語法:
type(object)
type(name,bases,dict)
- name -- 類的名稱。
- bases -- 基類的元組。
- dict -- 字典,類內定義的命名空間變量。
0X03;舉例:
1 print(type(1)) 2 print(type('1')) 3 print(type([2]))
#運行結果: C:\Users\aaron\Desktop\Pytoon-cade\venv\Scripts\python.exe C:/Users/aaron/Desktop/Pytoon-cade/urllib-Study.py <class 'int'> <class 'str'> <class 'list'> Process finished with exit code 0