Review: Functions


#1



https://www.codecademy.com/courses/python-beginner-c7VZg/4/1?curriculum_id=4f89dab3d788890003000096#

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: unindent does not match any outer indentation level (python, line 9)

please help me on this lesson


Replace this line with your code. 
def speak(message):
    return message

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


#2

new update of code

def speak(message):
return message

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


#3

In your elif statement s = "no" looks to be one space to far forward.


#4

fixed it but

it still says this error 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: unexpected indent (python, line 9)


#5

def speak(message):
return message

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


#7

huh?........................................wut i dont' get it


#8

Sorry, I started writing a response that accidentally got posted before it was ready so it would have been useless.

I am not exactly sure why you are getting the indent error since the way it is posted here on the forums I can't see spacing, but I am assuming you have it space liked this:

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

Or like this:

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

If it is formatted like either of those two options it will not give you an indent error, but it won't like it either.

If you look closely at the instructions they are asking for a function named shut_down to be created. I would recommend reading over the instructions again and seeing where it takes you.

If you are still having issues by all means post them and I will attempt to guide you in the right direction.


#9

ok................................will do


#10

Copied code deserves litte or no explanation. This thread is going nowhere fast. Suggest go back to the beginning of the lesson, read it carefully and do this exercise again, without peeking at other solutions or questions. If we cannot spot the errors in what we are copying, how are we to fix them or understand what we're supposed to be learning?


#11