What's wrong in the code


#1

instructions:01. First, def a function, shut_down, that takes one argument s. Don't forget the parentheses or the colon!
02. Then, if the shut_down function receives an s equal to "yes", it should return "Shutting down"
03. Alternatively, elif s is equal to "no", then the function should return "Shutdown aborted".
04. Finally, if shut_down gets anything other than those inputs, the function should return "Sorry"
def shut_down(s):
return s
if s=='yes':
return shut_down("Shutting down")
elif s=='no':
return shut_down("Shutdown aborted")
else:
return shut_down("Sorry")


#2

Hi @bitninja80149 ,

Because the code that you posted is not formatted, it is difficult for other users to read and debug it. After code has been pasted into the editing window for posting, you can format it by selecting it, and then by clicking the </> button above the editing area. Alternatively, you can place three backquotes on the line before the code and three backquotes on the line after the code. This will enable us to see important details, such as the indentation and underscores.

Inside your shut_down function, you are calling the shut_down function. In this exercise, that should not be done.

Instead of this ...

return shut_down("Shutting down")

... do this ...

return "Shutting down"

Use a similar pattern for the other return statements.