May-31-2023, 07:37 AM
(This post was last modified: May-31-2023, 07:47 AM by Gribouillis.)
Hi I am a new to Python. Can somebody explain me how this program works and particularly the flow of program. Why the output shows as "inner". Regards and Thanks in advance.
def outer(): x = 3 def inner(): y = 4 result = x+y return result return inner a = outer() print(a.__name__)
Output:output:
inner
Gribouillis write May-31-2023, 07:47 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Attached Files