I really do not know why there is problem in line 2


#1

def shut_down(s):

if s == "yes":
return shut_dow("shutting down")

elif s == "no":
return shut_dow("shutdown aborted")

else:
return shut_dow("sorry")

but it does not work and says
File "python", line 3
if s == "yes":
^
IndentationError: expected an indented block


#2

From the error showing on your console, you have issues with all the returns. Ensure you indent properly by hitting the enter key after your colon ( : ). You return this way.

return "Shutting down"

return "Shutdown aborted"

return "Sorry"

Be case-sensitive with writing your codes. :slight_smile:


#3

Oh, it works, thank you so much:slight_smile:


#4

Hi I have got a question I don't understand why there is no 'n' on
return shut_dow("shutting down")

is this a problem with the website or is it something that has to be done


#5

There is n on shut_down. But, that code you quoted on return statements by the original OP, isn't right.

I wrote the write stuffs above. :slight_smile:


#6

yeah, problem solved, thanks

2016年9月2日星期五,B codecademy@discoursemail.com 写道:


#7

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