How can I print out the correct response based on input?
<p>I'm new to Python and I have a very simple problem that I'd like explained to me. I'm making a text adventure game and I'd like to be able to call another function inside a function so my code is organized better. </p>

<p>This is what I have that's working:</p>

<pre><code>def displayIntro():
    print("You come to a crossroads on your trip home.")
    print ("You can go LEFT towards the DEMON FOREST or RIGHT to SKULL MOUNTAIN")
    print()

def choosePath(): 
    path = ""
    while path != "LEFT" and path != "RIGHT":
        path = input("Which path will you choose? LEFT or RIGHT? --&gt; ")
    if path == "RIGHT":
        print("You take the path to SKULL MOUNTAIN.")
    elif path == "LEFT":
        print ("You take the path to the DEMON FOREST.")




displayIntro()
choosePath()
choosenPath() 
</code></pre>

<p>But I'd like it to look something like this, but I don't know how to make it work:</p>

<pre><code>def displayIntro():
    print("You come to a crossroads on your trip home.")
    print ("You can go LEFT towards the DEMON FOREST or RIGHT to SKULL MOUNTAIN")
    print()

def choosePath(): 
    path = ""
    while path != "LEFT" and path != "RIGHT":
        path = input("Which path will you choose? LEFT or RIGHT? --&gt; ")
    return path


def checkPath(choosePath):

    if choosePath == "RIGHT":
        print("You take the path to SKULL MOUNTAIN.")
    elif choosePath == "LEFT": 
        print("You take the path to the DEMON FOREST.")



displayIntro()
choosePath()
checkPath() 
</code></pre>

<p>You're not passing the return value of <code>choosePath()</code> to <code>checkPath()</code>. It should be:</p>

<pre><code>path = choosePath()
checkPath(path)
</code></pre>

<p>Or as a one-liner:</p>

<pre><code>checkPath(choosePath())
</code></pre>

python