Review Functions


17. Review: Functions

I get the following error (no error appears in the console, only in the red pop-up box):

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

Thanks in advance for your help!

Here is the code I was submitting

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


if shut_down('yes'):


elif shut_down('no'):

You're calling function as a condition of if/elif statement?
should not we compare it with s?

if s == 'yes':
and create same changes with elif's condition!

I hope this hint works for you! :slight_smile:


It certainly has, thank you! Such a quick reply too. I guess I should get well acquainted with you lovely people in the Q&A section as I wander deeper into the rabbit hole...:slight_smile:


You're welcome ! :slight_smile:
keep up the good work! :thumbsup:


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