Hi, i dont whats wrong with my code.please help


def shut_down(s):
return s

if yes():
    shut_down("Shutting down")
elif no():
    shut_down("Shutdown aborted")
else :

error : Oops, try again. Your function failed on the message yes. It returned 'yes' when it should have returned 'Shutting down'


Try thinking of it this way...if you are entering in a value called s.
you now want to check s against 'yes' or 'no'

so try somethng like this

if s == 'yes':
return "Shutting down"
then follow this idea using your elif for comparing to 'no'
and if there is nothing entered return 'sorry'

and make sure to indent correctly....good luck


Hi i saw your comment, i em stuck on this lesson for long
so if you solved it , your help would be great
here is code i wrote , i think it is according yours suggestion but it still do not work:(


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


Hi i finaly solve it

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

take care of intedning of lines


Great job sticking with it and not giving up....thats the best way to learn


I have a problem with the same code.

It returns a meaningless error message. Is this a joke?


Ok, I saw my mistake. I: wrote "shot" instead of "shut". :stuck_out_tongue_winking_eye:
We wouldn't really want to do that. :laughing:


@violetanka after changing this do your programme worked or not if yes please tell me


Yes, it worked. But you should first try to solve it yourself and try to find your mistakes rather than looking at the solution as soon as you get the error message. Otherwise you won't learn much. If you have already tried, it is OK. :smiley:


thank u all. It worked.
@billmac1701 thank you for your help.