7/17


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

Current code. The shut_down function is throwing the error "maximum recursion depth exceeded"


#2

Should your function call itself?


#3

To gain knowledge try a google search
python maximum recursion depth exceeded site:stackoverflow.com
= http://stackoverflow.com/questions/16577006/python-recursive-function-error-runtimeerror-maximum-recursion-depth-exceeded

Now to your shut_down(s) function....
the s between the parentheses is a so-called parameter
this parameter s is used as a variable within the function.

So if you call the function shutdown
and as the shutdown function was defined as having 1 parameter s
you will have to provide 1 argument in our case a string Value
like
shutdown("yes")

In your IF ELIF ELSE statement structure
in the IF and the ELIF both have a to declare a condition
like
s == "yes"

def shutdown(s):
    if s == "yes": 
        print "I am shutting down ....."

shutdown("yes")