What's wrong here guys? let me know


#1

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


#2

It's not indented, so it will not run at all.

If you mean that you have a different piece of code that behaves differently from what you want, then you'll have to show us that code and explain what it is doing differently from what you want!

I also think that if you simply read the code and execute it in your head, it will be quite evident what it's doing differently from what you want. If not, then you can add print statements in it to see what it does as it runs.


#3

guys help i've tried everything and i cant see any problems

def shut_down(s):

if (s)==yes:
    return "shutting down"
elif (s)==no:
    return "shut down aborted"
else:
    return "sorry"

#4

thank you ... Now i need to focus more on it.


#5

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

This worked for me , for some reason


#6

Pretty sure you don't need those parenthesis. In addition make sure you type out what the instructions ask you to type out. If they ask you to type for a response "No Thank You" you type out No Thank you not "no thank you".


#7

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