Review: Function - final output


#1

How do I view the output of the code I've written? For this Review: Functions exercise, I'd like to see output that says "Shutting Down" or "Shutdown aborted", rather than "None".

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

`


#2

Write a call expression containing,"yes" or "no" (or anything)...

print shut_down("yes")

#3

hi @jasnam im having the same problem, do you get the error message, 'oops try again Did you create a function called shut_down?. looks like we both did the same thing and i cannot figure what is wrong, ill try to set out the code the way ive entered it including the indents.

def shut_down(s):
if (s == yes):
return "shutting down"
elif (s ==no):
return "shutdown aborted"
else:
return "sorry"


#4

s is a string, so its value should be in quotes.

if s == "yes":

#5

thanks @mtf roy your explanation helped me understand a bit more and solved the problem cheers bud.