def f1(): x = 88 def f2(): print x return f2action = f1() # make, return functionaction() # call it now: prints 88