共計 213 個字符,預計需要花費 1 分鐘才能閱讀完成。
typeof
不是 Python 內置函數,正確的是使用 type
函數來獲取對象的類型。type
函數的作用是返回一個對象的類型。例如:
x = 5
print(type(x)) # <class 'int'>
y = "Hello"
print(type(y)) # <class 'str'>
z = [1, 2, 3]
print(type(z)) # <class 'list'>
丸趣 TV 網 – 提供最優質的資源集合!
正文完