Review: functions


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


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


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

Review: Functions

string comparison is case sensitive.


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


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