Review: functions


#1

Hi guys, could you help me out with my code?

Code:

def shut_down(s):   
    if s == "yes":
        return ("Shutting down")
    elif s == "No":
        return ("Shutdown aborted")
    else:
        return ("Sorry")

Error:

Oops, try again. Your function failed on the message no. It returned 'Sorry' when it should have returned 'Shutdown aborted'


Review: Functions
#2

string comparison is case sensitive.


#3

line 4 should be
elif s=="no"
and not
elif s=="No"


#4

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