[issue22202] Function Bug?
Reza Shahrzad added the comment: Hi Steve, Thank you very much for your prompt reply, explanation and the concise resolution included. I guess, it will be a while before I can hope to find any real bugs in Python and that is something a beginner such as myself should only be grateful for! Thanks again, Respectfully, Reza Shahrzad -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22202 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22202] Function Bug?
Steven D'Aprano added the comment: Thank you for the extensive examples, but I'm afraid this is not a bug. In your code, result is a local variable, which means it only exists inside the fib() function. When you try inspecting result, it fails because there is no global variable result. Try doing this instead: result = fib(100) result result[3] and it should work as you expect. (By the way, it doesn't matter if the local variable inside the fib() function and the global variable are different names or the same, in both cases they are considered different.) -- nosy: +steven.daprano resolution: - not a bug ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22202 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22202] Function Bug?
Changes by Steven D'Aprano steve+pyt...@pearwood.info: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22202 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com