17/19: Help! I'm stuck!


#1



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

When I hit the "Save and submit code" the following mesaage appears:

"Oops, try again. Your code looks a little bit off. Feel free to peek back at earlier excercises if you need a refresher! Your code threw the following error: expected an indented block (Python, line 2)".

What am I doing wrong? Here's my code:


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


#2

Hi you should indent the if, elif and else statement
An example

def funName():
   if condition:
       #do something
   elif condition:
       #do something
   else:
       #do something

#3

I finally figured out how the console points to your error.

In the console the little ^ points to exactly what is wrong. As to how to solve it , that is a different matter.
Though I I think I know how to sole your problem.

Your code is this:

if s=="yes":

Where it should look like this:

if s == "yes":

You are missing the spaces, at least my code ran fine when I entered it as so. As well as the post above, you need to indent your statements. Hope that helps.