Please help!


#1

what’s matter with this code?

def shut_down(s):

if shut_down(s) :
s=="yes"
return ‘Shutting down’

elif shut_down(s):
s=="no"
return ‘Shutdown aborted’

else:
return ‘Sorry’


#2

In our if/elif/else statements (before the colon), that’s where we should check if s is equal to our string.


#3

Thank you !! :smiley:


#4


No way :confused:


#5

Check out this example:

def myfunct(n) #we define our function
     if n == "" #our statement belongs to myfunct(), so we indent it.
        return "" #since this the result if true, we will indent it...
                      #... under our if statement.

So, anything indented under our function/statement, belongs to it. Check out the error Python is giving you, it tells you the issue, where it is, and how to fix it. :smiley:


#6

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