标签: python-3.x
def make_repeater(f, n): def a(x): total = x while n > 0: total = f(total) n -= 1 return total return a
make_repeater(lambda x:x + 1,3)(5)
获取错误:UnboundLocalError:赋值之前引用了本地变量'n'
如何解决这个问题?