Review: Functions


I am not really sure what's wrong with the code. It keeps telling me invalid syntax with line two.

def shut_down(s):
     if s == "yes"
     return "Shutting Down"

     s == "no"
     return "Shutdown aborted"

     return "Sorry"


I have indents, they just didn't show up on here.


Could you post a link to the lesson :slight_smile:


The return lines in the if and elif branches need one more indent.


On line 2 you forgot the colon

Your code:
if s == "yes"

should be:
if s == "yes":

Also your elif statement is a bit off

Your code:
s == "no"

should be:
elif s == "no":

hope this helped:)


Thank you @mtf and @anthonyb19631963, it worked :slight_smile:


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