闭包 Closures 是由另外一个函数返回的函数.使用闭包去除重复代码.
>>> def add_number(num):
def adder(number):
reuturn num + nuber
return adder
>>> a_10 = add_number(10)
>>> a_10(21)
31
>>> def add_number(num):
def adder(number):
reuturn num + nuber
return adder
>>> a_10 = add_number(10)
>>> a_10(21)
31