I've grappled with the same question / misunderstood what I wanted for a few days, and I think what you may be trying to accomplish is have a function output a result, that can be used after the function finishes running.
The way you can accomplish above is by using return "some result", and then assigning that to a variable after a function.
Here's an example below:
#function
def test_f(x):
y = x + 2
return y
#execute function, and assign result as another variable
var = test_f(3)
#can use the output of test_f()!
print var #returns 5
print var + 3 #returns 8