I'm on Review: Functions


#1



Replace this line with your code.


#2

I have this code

def shut_down(s):
    return s

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

#3

why doesnt it work? i was just trying different ideas and none of them work


#4

Yes and no should be strings...are they? Also, it makes it much easier if you format your code with the </> button when writing a post ( you'll see it the post toolbar category when you are writing/editing your post).


#6

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


#7

Hi, do you have a problem with your code?


#8

No it ran just indent properly, I couldn't figure out how to paste it with
indentions


#9

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