Fork自 inscode / Python
def test_closure_func(): # 调用外部函数 closure_func = outer_func(5) # 调用闭包函数,将结果与期望值比较 assert closure_func(10) == 15 assert closure_func(20) == 25 assert closure_func(-5) == 0 test_closure_func()