Review Functions


#1



Review: Functions


Did you create a function called shut_down?


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


#2

that was an old code my current one is
def shut_down(s):
if shut_down == yes:
return "Shutting down"
elif shut_down == no:
return "Shutdown aborted"
else :
return "Sorry"


#3

yes and no are strings, so you should use quotation marks around them (")


#4

thanks but now it is giving me:
Your function failed on the message yes. It returned 'Sorry' when it should have returned 'Shutting down'


#5

your compare the strings with the function, rather then the function parameter (s)


#6

thank you it works now


#7