Oops, try again. Your function failed on the message yes. It returned 'yes' when it should have returned 'Shutting down'
<p>Here is my pyhton practice program: </p>

<pre><code>def shut_down(s):
    return s

    if yes():
        shut_down("Shutting down")
    elif no():
        shut_down("Shutdown aborted")
    else:
        shut_down("Sorry")
</code></pre>

<p>the question given to me are:</p>

<ol>
<li>if the shut_down function receives an s equal to "yes", it should return "Shutting down"</li>
<li>elif s is equal to "no", then the function should return "Shutdown aborted".</li>
<li>if shut_down gets anything other than those inputs, the function should return "Sorry"</li>
</ol>

<p>Couple of points:</p>

<ul>
<li>Misplaced return statement. Should be at end.</li>
<li><code>if yes():</code> It is wrong. You want to compare function input with yes. It should be <code>if s == 'yes':</code>. Same for rest also.</li>
<li>Since you have written function definition as <code>def shut_down(s):</code>, it is expecting one argument. You should pass one argument while calling this function as <code>shutdown(yes)</code></li>
<li>Once you called function and since your function has return statement, it will return some value, which you should catch like <code>ret = shutdown(yes)</code> </li>
</ul>

<p></p>

<pre><code>def shut_down(s):

    if s == "yes":
        r =  "Shutting down"
    elif s == "no":
        r =  "Shutdown aborted"
    else:
        r = "Sorry"
    return r


ret = shut_down("yes")
print (ret)
</code></pre>

python python-2.7 python-3.x