17 - Functions:review


I honestly don't know what's wrong with it. Someone please help :cry:

def shut_down(s):

      if (s) == "yes":
            shut_down("Shutting down")

      elif (s) == "no":
            shut_down("Shutdown aborted")



You called your function inside itself before it's defined. The starred items are wrong.

    def shut_down(s):

        if (s) == "yes":
            *shut_down*("Shutting down")

        elif (s) == "no":
            *shut_down*("Shutdown aborted")



Thank you @cadecodes, I will bear this in mind. In the mean time, you get a free cookie



Thanks man! :wink: I love cookies!


Do you have to add the return function? I'm asking this because I don't know...


Yes, this is proper for the function.


Hey can you please tell me whats wrong with my code

def shut_down(s):
return s

if s == "yes":
return "Shutting down"

elif s == "no" :
return "Shutdown aborted"

else :
return "Sorry"


You return s before the if and elif statements. So instead of going through the if, elif and else statements your function returns s already. Delete the "return s" and it should work.