What am i doing wrong? 17.Review: Functions



Oops, try again. Your shut_down function threw the following error: maximum recursion depth exceeded

i expect it to be riht

Replace this line with your code.


my code:

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


s will contain the string, so you should compare s with "yes" and "no"


if shut_down(s)

is a function call, don't call the function inside the function, it will cause endless recursion (sort of like an infinity loop)


Oh, Thanks! It's working for me now.