• 2022-10-26
    要显示模块math中的所有函数,使用的命令是:
    A: importmath
    B: dir(math)
    C: help(math)
    D: list(math)
  • B

    内容

    • 0

      引用math模块中sqrt函数的导入语句,下列错误的语句是:( ) A: import math B: from math import sqrt C: from sqrt import math D: from math import *

    • 1

      如果要从math模块导入sqrt函数,可以使用语句“from sqrt import math”。

    • 2

      以下导入模块的方式中,错误的是_______。 A: import math B: from math import pow C: from math import * D: from * import math

    • 3

      关于 import 引用,下列选项中描述错.误.的是 。 A: import 保留字用于导入模块或者模块中的对象 B: 使用 import math 可以引入 math 库 C: 使用 import math as m 可以引入 math 库并取别名 m D: 可以使用 from math import sqrt 引入 math 库

    • 4

      ​如果想要查看math库中pi的取值是多少,可以利用以下什么方式(假设已经执行了import math,并且只要包含pi取值就可以)?​ A: help(math) B: print(pi) C: dir(math) D: print(math.pi)