请完善装饰器 repeat 函数代码,实现输入任意正整数,打印 n 次 hello。
repeat
hello
def repeat(num: int): pass @repeat(n) def print_hello(): print("hello")
def repeat(num: int): def new(old): for i in range(num - 1): old() return old return new @repeat(n) def print_hello(): print("hello")