题目内容

关于装饰器,下列说法中错误的是()

A. 装饰器是用来包装函数的函数
B. 装饰器有利于实现代码的复用
C. 装饰器中一定要返回一个函数对象
D. 一个函数只能用一个装饰器修饰

查看答案
更多问题

调用装饰器的格式是()

A.
B. 装饰器名
C. @装饰器名
D. $装饰器名
E. %装饰器名

n= range(0,10,2)result = map(lambda x : x**2,n)print(list(result))

A. {0,4,16,36,64}
B. [0,2,4,6,8]
C. [0,4,8,12,1]
D. [0,4,16,36,64]

numbers = range(-5,5)f = filter(lambda x:x>0,numbers)print(list(f))

A. [1,2,3,4,5]
B. [-5,-4,-3,-2,-1,1,2,3,4,5]
C. [1,2,3,4,]
D. [-4,-3,-2,-1,1,2,3,4]

Which of the following statements about copy constructor and conversion constructor is incorrect?

A. Both copy constructor and conversion constructor deal with the same data type
B. Copy constructor is used to create the same user-defined type
Conversion constructor can convert an object of a built-in type into an object of a user-defined type
D. Copy constructor means that the copy of a class object is a copy of each member, i.e. default member-wise initialization

答案查题题库