Functions review halp pls


#1



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"
else:
    return "sorry"


#2

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


#3

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


#4

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?


#5

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


#6

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:


#7

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