Passing variables between functions in Python
<p>Ok so I am having a tough time getting my head around passing variables between functions:</p>

<p>I can't seem to find a clear example. </p>

<p>I do not want to run funa() in funb(). </p>

<pre><code>def funa():
    name=input("what is your name?")
    age=input("how old are you?")
    return name, age

funa()

def funb(name, age):
    print(name)
    print(age)

funb()
</code></pre>

<p>Since <code>funa</code> is <em>returning</em> the values for name and age, you need to assign those to local variables and then pass them into funb:</p>

<pre><code>name, age = funa()
funb(name, age)
</code></pre>

<p>Note that the names within the function and outside are not linked; this would work just as well:</p>

<pre><code>foo, bar = funa()
funb(foo, bar)
</code></pre>

python