Reveiw functions


#1


def shut_down(s):
if s== "yes":
   return "shutting down"
elif s== "no":
   return "shutdown aborted"
else:
    return "sorry"

i don't know what i did wrong here and its says File "python", line 2
if s== "yes":
^
IndentationError: expected an indented block


#2

you should indent the if statement so it is nested inside the function:

def example():
   if True:
       print True

#3

#4

Then why does example code not indent? Very annoying to have bad or non-functional examples. I don't understand why Code Academy consistently provides poor references.


#5

because the design of there program is different? If everything is already shown how it should be exactly done, you don't learn anything, you should have deduced from the instructions that the if should be indented so that is it inside the function, see instructions:

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

this clearly indicates the if should be nested inside the function


#6

Using tab before each line after the first.
It will be right when you retract is correct.


#7