Review Functions


#1



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'
    else:
        return 'Sorry'


#2

if shut_down('yes'):

and

elif shut_down('no'):

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

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

I hope this hint works for you! :slight_smile:


#3

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:


#4

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


#5

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