1 def f(): 2 def g(x): 3 if x <= 0: 4 return x 5 return g(x - 1) + x 6 return g 7 8 a = f() 9 b = a(3)