How to solve Review: Functions


#1

def shut_down(s):
return s
if (s == "yes"):
return "Shutting down"
elif (s == "no"):
return "Shutdown aborted"

   else: 
    return("Sorry")

#2

Returning this function parameter with retun s,

will end the function than intended. That's what should be happening in the condition block, if a particular condition is fulfilled. Try removing that return statement and see.


#3

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