1.外函数固定
2.内函数调用
3.以后调用可以节省 a,b 输入
def test(a,b):
def test_in(x):
print(a*x+b)
return test_in
line1 = test(1,1)
line1(0)
line2 = test(10,4)
line2(0)
line1(2)
'''
1
4
3
'''
1.外函数固定
2.内函数调用
3.以后调用可以节省 a,b 输入
def test(a,b):
def test_in(x):
print(a*x+b)
return test_in
line1 = test(1,1)
line1(0)
line2 = test(10,4)
line2(0)
line1(2)
'''
1
4
3
'''
转载于:https://www.cnblogs.com/alamZ/p/7147921.html