Function Review


#1

It doesn't work. could you guys please check where did I do wrong?
def shut_down(s):
if s = "yes":
return "Shutting down"
elif s = "no":
return "Shutdown aborted"
else:
return "Sorry"


#2

What makes you say that it doesn't work, what are you looking to change?
Can you post an intact version of the code?


#3


Here it is


#4

What does the error message there seem to be saying?

If you know what you intend to do, you could try to find an example for how to do that, and then compare that to your code.

There's no point in trying to remember everything, get good at looking things up instead. If you use it a lot, then it'll stick eventually.

https://www.google.com/webhp?#q=python%20if-statement


#5

I got it now. it's syntax error. Thank you anyway:relaxed:


#6

s == "yes" and s == "no"


#7

yes, i got it now. Thank you methodace41550:smile:


#8

What is the right solution on this question? I also get stuck in it.


#9

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