Issue with code on 17


#1



Oops, try again. 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 6)

I want it to say "Shutting down" if s == yes, if s == no, it should say "Shutdown aborted", if s == anything else it should say "Sorry"
EDIT: I fixed the issue.


def shut_down(s):
    return s


if s == "yes":
    return "Shutting down"
elif s == "no":
    return "Shutdown aborted"
else:
    return "Sorry"


#3

the example shows you some syntax, your program is differently designed then the example. Take a good look at the instructions how your program should be designed


#4

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