方法 type(variable_name) 示例 a = 'hello' b = type(a) print(b) a = 10 b = type(a) print(b) 结果 <class 'str'> <class 'int'>