首页试题详情
难度: 使用次数:138更新时间:2026/03/16
1.
在Python中,如何正确地从math包中导入sqrt模块?
A.import math.sqrt
B.from math import sqrt
C.import math
D.from math import *sqrt
题型:选择题 知识点:第十章 模块与包
【答案】
B
【解析】
正确的方式是从math模块中导入sqrt函数。使用'from math import sqrt'语句可以单独导入sqrt函数,而'import math'则需要使用math.sqrt()来调用。

查看答案和解析

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

低至 ¥0.1 起

类题推荐:

未分类