第26562题 单选
执行给定的Python装饰器与递归相关代码,输出结果是以下哪一项?

阅读下面的Python代码,执行后其输出是()。

stepCount = 0
def countIt(Fx):
    def wrapper(*args,**kwargs):
        rtn = Fx(*args,**kwargs)
        global stepCount
        stepCount += 1
        print(stepCount,end="->")
        return rtn
    return wrapper

@countIt
def fracA(N):
    rtn = 1
    for i in range(1,N+1):
        rtn *= i
    return rtn

@countIt
def fracB(N):
    if N == 1:
        return 1
    return N*fracB(N-1)

print(fracA(5),end="")
print("<===>",end="")
print(fracB(5))
A

1->120<===>2->120

B

1->120<===>1->120

C

1->120<===>1->2->3->4->5->120

D

1->120<===>2->3->4->5->6->120

程序运行统计
暂无判题统计