Pythonのtypeof関数の目的は何ですか?
type()は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'>