Review: Functions


#1

It won't work help.
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):

we can't check like this.
instruction

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


#3

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


#4

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


#5

sorry it didnt helped


#7

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


#8

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