What should I do right?


#1


https://www.codecademy.com/courses/python-beginner-c7VZg/4/1?curriculum_id=4f89dab3d788890003000096


Oops, try again. Your function failed on the message yes. It returned 'yes' when it should have returned 'Shutting down'


It should work

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

#2

So let's say that we call our function with parameter "yes":

print shut_down("yes")

In the first line of function:

return s

function will return passed parameter -> "yes" and execution of function will be terminated.


What is the purpose of this line:

return s

?


#3

Ohhhhhh! I get it now !! :slight_smile: Thanks... I removed the return s line and it works now


#4

You're very welcome :slight_smile:


#5

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