单项选择题
在Python中,如何创建一个装饰器?()
A.def decorator(func)
B.@decorator
C.with decorator
D.A和B都对
点击查看答案&解析
相关考题
-
单项选择题
在Python中,如何获取一个模块的所有函数和变量?()
A.dir(module)
B.module.__all__
C.module.__dict__
D.module.list() -
单项选择题
在Python中,如何创建一个匿名函数?()
A.lambda
B.anonymous
C.func
D.none -
单项选择题
在Python中,如何向一个函数传递不定数量的参数?()
A.*args
B.**kwargs
C.varargs
D.A和B都对
