Why does this not work?


Hi, why does this not work?

def shut_down(s):
if s == "yes"
return "Shutting down"
elif s == "no":
return "Shutdown aborted"
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

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":


Oh thankyou.

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


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