I can't find the problem here


#1

I can't find the problem here:

def shut_down(s):
return s
if s == "yes":
return "Shutting down"
elif s == "no":
return "Shutdown aborted"
else:
return "Sorry"


17. Review: Functions
#2

It is simply this line:

Just remove it, because this return line will cause the function to terminate before the if and elif and else statements are ever even considered :slight_smile:


#3
def shut_down(s):
    if s==yes:
        return "Shutting down"
    elif s==no:
        return "Shutdown aborted"
    else:
        return "Sorry"`

Hi, as seen above, I did exactly as you suggested. However there's still this error message:

Oops, try again. Did you create a function called shut_down?


#4

Get rid of line 2 and indent lines 2,4,6 and double indent lines 3,5,7.


#5

still a problem
def shut_down(s):
if s==yes:
return "Shutting down"
elif s==no:
return "Shutdown aborted"
else:
return "Sorry"


#6

Hi @corejumper16031,

look at statements like this:

and this:

do you see what might be missing here? What are you supposed to be comparing s to?

Hint: for easy reference, I have once again copied the instructions over here,and made the key thing more obvious:

Then, if the shut_down function receives an s equal to "yes", it should return "Shutting down"
Alternatively, elif s is equal to "no", then the function should return "Shutdown aborted".

P.S. @christerthegod, your problem is the same. Give it a shot!