Ask your own question, for FREE!
Computer Science 14 Online
OpenStudy (anonymous):

code is in python def a(x,y,z): if x : return y else: return z def b(y,z): return(y>z , y , z) now if we do >>>b(a , b) it returned the function a so i want to know that how python is comparing two functions , here they are a and b.?

OpenStudy (anonymous):

may go to this : http://docs.python.org/library/functions.html

OpenStudy (anonymous):

That's a good question. I believe that the functions themselves are not being compared, their memory addresses are being compared, which is not particularly meaningful. Also, I believe you can't even do this is Python 3 (I mean, why would you want to?).

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!