Review function


I put this in:

def shut_down(s):
return s

if s == "yes":
return "shutting down"
elif s == "no":
return "shutdown aborted"
return "Sorry"

and I'm getting the error:

Your code looks a bit off. Feel free to peek back at earlier exercises if you need a refresher! Your code threw the following error: 'return' outside function (python, line 5)

Review : functions

Look the indentation


If you are going to reply to an existing topic, please read the answer in this topic. Because they cover all the problems you have.

@neriyah, the lack of indention is just because no format/markup is used


Try out this code.

Note: Use proper indentation.

def shut_down(s):

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


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