Review: Functions not working


#1




File "python", line 4
SyntaxError: 'return' outside function


I need it to return, which its not.


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


#2

This is a review exercise, and the indications above are that the entire unit needs to be reviewed and practiced. Please review.


#3

Could you please just explain what I did wrong?


#4

Please explain what this is supposed to do.


#5

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