Execute certain code in function (Calling function in function)? Python : <p>I want to execute a certain lines of codes in a function and not other ones.</p>

<p>Example:</p>

<pre><code>def function1():
    print("execute function 1")
    def function2():
        print("execute funciton 2")

    def function3():
        print("execute function 3")

function1()
</code></pre>

<p>This gives an output of: <code>execute function 1</code> </p>

<p>How can i get an output of 
<code>execute function 1</code> 
<code>execute function 2</code> </p>

<p>Or <code>execute function 1</code> <code>execute function 3</code> </p>
