Problem in function review topic


#1

Dear Sir,
In this below code i can't understand that how does it work ? like below happy,sad are doesn't define and what speak does in return line or print line........ if your help to get out from this code it will be great support for me.

def speak(message):
    return message

if happy():
    speak("I'm happy!")
elif sad():
    speak("I'm sad.")
else:
    speak("I don't know what I'm feeling.")

My regards,
TBIKU


#2

Is this your code executed or is it asking for an explanation of the example of the statement of whose lesson?


#3

Yeah sir this code i just copy from one of your lesson (preview of function) and i can't understand how this happy ,sad came for if function . If i run this code it gives me happy not define.....etc.

My regards,
TBIKU


#4

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