0
Anybody answer the output of the code?
4 Respostas
+ 4
You know you can run the code 'yourself' and see right?
+ 4
Netha_r2071 in that case you should always write a suitable description like "I don't understand the output of the code". Your title doesn't make much sense. Just remember this from now on.
As for the explanation, it is quite simple. Every function in Python has a property __name__, which holds the name of the function. So in the program, `output` has the value `fu`, which is a function. So its `__name__` property gives the name of the function that is "fu".
+ 1
__name__ returns the name of the actual function:
other = fu # fu is the actual funtion
fu1 = other
print ( fu1.__name__ ). # fu
0
XXX I ran, but I didn't knew how was the output happened to be!
BTW, I'm not that ignorant to see and understand the output, if I can!