首页试题详情
难度: 使用次数:138更新时间:2026/03/16
1.
下列代码中,哪一个是正确的 type 检测方式?
A.type(x) == int
B.type(x) is int
C.x.type() == int
D.x is int
题型:选择题 知识点:第四章 函数与模块
【答案】
B
【解析】
Python 中检测类型推荐使用 isinstance() 或 type() == 类型,而 type() is 类型 是正确的判断方式。

查看答案和解析

支付 ¥0.1 即可查看此题答案和详细解析

低至 ¥0.1 起

类题推荐:

未分类