Review: Functions


It won't work help.
def shut_down(s):
if shut_down(yes):
return "Shutting down"
elif shut_down(no):
return "Shutdown aborted"
return "Sorry"


if shut_down(yes):

we can't check like this.

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

here s is a parameter when you'll pass an argumnet it'll receive it.

how can we check whether two values are equal or not? check it

and make sure you've proper indentation


The example they give throws you off. Don't try to copy their code and only switch variable names.


def shut_down (s):
return shut_down
if s == yes:
return "Shutting down"
elif s == no:
return "Shutdown aborted"
return "Sorry"
Try this code and see where you are wrong


sorry it didnt helped


A post was split to a new topic: 'return' outside function


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