Functions review recusion error


#1



https://www.codecademy.com/courses/python-beginner-c7VZg/4/1?curriculum_id=4f89dab3d788890003000096#

def shut_down(s):

if shut_down(s):
    s == "Yes"
    return "Shutting down"
elif(s): 
    s == "no"
    return "Shutdown Aborted"
else:
    return "Sorry"

I have looked through many other posts to see what i was doing wrong and fixed what I could, but after those fixes I started receiving the error : "Oops, try again. Your shut_down function threw the following error: maximum recursion depth exceeded".


#2

This seems to be your problem. Take out shutdown(s); and try molding it just using s = "yes" like your elif statement.


#4

the elif statement leads to an invalid syntax @sharon1976


#5

thanx you are the best :smile:


#7

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