def f(x): def h(q): return q + y + z global y y=x z=1 return y + x def g(): return y,y