Why does this not work?


#1

Hi, why does this not work?

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

I get this error: Your code looks a bit off. Feel free to peek back at earlier exercises if you need a refresher! Your code threw the following error: invalid syntax (python, line 2)


17. Review: Functions
#2

Next time, I suggest making your own topic, (just press the letter c on your keyboard when you're not in a text box), because people will be able to help you more.

you're missing a colon, :
It should look like

if s == "yes":

#3

Oh thankyou.

It's my first time commenting. Thanks for the tip! I will do :slight_smile:


#5

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