Review: Functions


I've been trying to complete this exercise for the best part of a month now, but I always get the same reference error:

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

Here the exercise is:

and here my code is:

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


HI is because you are calling the function inside the same function (in some case you can do it but this isn't it) try just to put as condition

if s == "yes":

do teh same for the else if statement


Thanks a lot, that worked great!


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