Review: function


#1

what is wrong with this code

def shut_down(s):
if s=="yes":
return ("shutting down")
elif s=="no":
shut_down("shutdown aborted")
else:
shut_down("sorry")

the error says maximum recursion depth exceeded in cmp


Review: Functions
#2

the code is indented properly


#3

here:

shut_down("shutdown aborted")

and here:

shut_down("sorry")

you call the function, you should return the string

by calling the function inside the function, you get recursion, and unless you have a base case, this recursion is endless. (sort of like an infinity loop)


#4

thanks I finally got this thing sorted out


#5