Error in python


#1

def shut_down(s):
return s

if s == 'yes':
return "Shutting down"
elif s == 'no':
return "Shutdown aborted"
else:
return "Sorry"

ERROR :
File "python", line 5
SyntaxError: 'return' outside function


#2

First, make sure you are indenting where you need to (I can't tell if you are because of the formatting here, but that error makes it seem like you need to indent your return statements). Second, it looks like you return "s" right away, but you are just returning the same phrase that was passed in. You need to use the s passed in and compare it. Do this by making sure all of your code is in the function's definition, and remove that first return statement you have so that the function does not exit immediately.