Review Functions


#1



Review Functions


Oops, try again. Your function failed on the message yes. It returned 'Sorry' when it should have returned 'Shutting down'


It should be returning 'Shutting Down' instead of 'Sorry'


def shut_down(s):
    if s == 'Yes':
        return 'Shutting down'

    elif s == 'No':
        return 'Shutdown aborted'
        
    else:
        return 'Sorry'

    
    
shut_down('Yes')


#2

Also, I tried printing it with my code instead of returning it and the console printed "Shutting Down' (which is the correct phrase it should be returning.)


#3

For this exercise, stick to lowercase inputs, yes and no, since that is what the lesson checker is using.


#4

Thanks so much, I would have never gotten it otherwise!


#5

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