typeof不是Python內(nèi)置函數(shù),正確的是使用type函數(shù)來獲取對象的類型。type函數(shù)的作用是返回一個對象的類型。例如:
typeof
type
x = 5 print(type(x)) # <class 'int'> y = "Hello" print(type(y)) # <class 'str'> z = [1, 2, 3] print(type(z)) # <class 'list'>
億速云公眾號
手機網(wǎng)站二維碼
Copyright ? Yisu Cloud Ltd. All Rights Reserved. 2018 版權(quán)所有
廣州億速云計算有限公司粵ICP備17096448號-1 粵公網(wǎng)安備 44010402001142號增值電信業(yè)務(wù)經(jīng)營許可證編號:B1-20181529