I'm on Review: Functions


Replace this line with your code.


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")


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


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).


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


Hi, do you have a problem with your code?


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


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