17. maximum recursion depth exceeded


#1

hi all
I am stuck on the Review:functions lesson number 17

i keep on getting the error message
'Oops, try again.
Your shut_down function threw the following error: maximum recursion depth exceeded'
here is my code

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

could somebody please tell me what is wrong with it and what i need to do to fix it


#2

Remove the shut_down in these two if and elif statements.


#3

Shouldn't he remove the function from the if and keep the s? Checking to see if parameter is yes no or other?


#4

Lol I meant to say it the other way around thanks for pointing out that. :slight_smile:


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.