Okay! Let’s review functions.

def speak(message): return message if happy(): speak("I'm happy!") elif sad(): speak("I'm sad.") else: speak("I don't know what I'm feeling.")

Again, the example code above is just there for your reference!



First, def a function, shut_down, that takes one argument s. Don’t forget the parentheses or the colon!

Then, if the shut_down function receives an s equal to "yes", it should return "Shutting down"

Alternatively, elif s is equal to "no", then the function should return "Shutdown aborted".

Finally, if shut_down gets anything other than those inputs, the function should return "Sorry"

Take this course for free

By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.
Already have an account?