Functions review halp pls


i tried none of it worked is their something im missing?

functions review

File "python", line 4
SyntaxError: 'return' outside function

Replace this line with your code. 
def shut_down(s):
    return shut_down
if s == 'yes':
    return "shutting down"
elif s == 'no':
    return "shut down aborted"
    return "sorry"


The program you are building has a different design then the example, use the example only for syntax, read the instructions to design the correct program


i checked over it i did what i though it said. can you give me an example?


i mean it said to use the return command but in the exaple it uses the argument so i dont really understand can you extend that please?


from the instructions:

Then, if the shut_down function receives an s equal to "yes", it should return "Shutting down"

this clearly indicate the if condition should be part of the function content. Parameters are local variable, s only exist inside the function


It worked for me, try to make some amendments
if s == yes: instead of if s == 'yes':
return("Shutting down") instead of return "shutting down"

Good luck :slight_smile:


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