Help funtion 17


help funtion 17

def shut_down(s):
if s == 'yes' :
return shut_down(shutting down)
elif s == 'no' :
return shut_down(shutdown aborted)
return shut_down(sorry)


You just need to return a string, why call the function when returning?


def shut_down(s):

if s == "yes":
    return "shutting down"
    elif s == "no":
        return "shutdown aborted"
            return "sorry"


if, elif and else should have the same indent level, given they have to be after each other


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