''return' outside function


#1

I need help. It says ''return' outside function (python, line 5)' and I can't seem to solve the problem

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

Please Help 17. Review: Functions
#2

the code in the example is just a syntax reminder, your program should have a different design.

Start again, follow the instructions


#3

2 posts were split to a new topic: Return outside function


#4

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