What's wrong with this python-function review?


#1

def shut_down(s):
return s

if yes():
shut_down('Shutting down')
elif no():
shut_down('Shutdown aborted')
else:
shut_down('sorry')


#2

I don't know if you still need an answer to that. But here is my suggestion, or at least, how I solved it.

def shut_down(s):
if s == 'yes':
return 'Shutting down'

elif s == 'no':
return 'Shutdown aborted'

else:
return 'Sorry'