第27510题 单选题
以下关于Python模块导入与成员调用的代码,哪一项是错误的?

已知存在一个自定义Python模块utils.py,其代码如下:

# utils.py
def add(a, b):
    return a + b
VERSION = "1.."
A

import utils; print(utils.add(2,3), utils.VERSION)

B

from utils import add, VERSION; print(add(4,5), VERSION)

C

from utils import add; print(utils.VERSION)

D

import utils as ut; print(ut.add(6,7), ut.VERSION)

程序运行统计
暂无判题统计
提交0次 正确率0.00%
答案解析