Review: function


what is wrong with this code

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

the error says maximum recursion depth exceeded in cmp

Review: Functions

the code is indented properly



shut_down("shutdown aborted")

and here:


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)


thanks I finally got this thing sorted out