17. Review pls help me


#1


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


it says 'Your shut_down function should take one parameter' but I think it has a parameter in it already???? I'm rlly confused please help


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


#2

lets add a function call:

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

# function call
print shut_down("yes")

so we provide an argument when calling the function to satisfy the function parameter (s), so all you need to do is compare s with "yes" and "no"

using s() would make s a function call, while s is a string.


#3

I got an error:
Traceback (most recent call last):
File "python", line 9, in module
File "python", line 2, in shut_down
TypeError: 'str' object is not callable


#4

because s is a string? How should you compare a variable containing a string and a string?

The code provided is not the solution, its just to help you


#5

oh I did it! thank u


#6