Review: Functions


#1



I am stuck on the Review of Functions.


This is my code

def shut_down(s):
if yes:
return("Shutting down")
elif no:
return("Shutdown aborted")
else:
return("Sorry")

But it says that i did not create the function shut_down

i expect that function shut_down is created because i used the def function_name():
code.

Please help me :smiley:

Replace this line with your code.


#2

It takes the parameter s, now by the directions, if s is equal to the string yes then you launch the first if return statement, elif s is equal to no you do the second return statement. Make sure to fix that.


#3

even though i added in the
s == yes
and
s == no
parts, it still says that i haven't created the function shut_down


#4

Remember that yes and no are going to be strings when they are passed into the function so you need to see if s == "yes" and then the same for no.


#5

ohhhhhhh
THANK YOU
:smiley:


#6

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