This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients rezashahrzad, steven.daprano
Date 2014-08-15.00:29:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1408062599.9.0.115961522727.issue22202@psf.upfronthosting.co.za>
In-reply-to
Content
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.)
History
Date User Action Args
2014-08-15 00:29:59steven.dapranosetrecipients: + steven.daprano, rezashahrzad
2014-08-15 00:29:59steven.dapranosetmessageid: <1408062599.9.0.115961522727.issue22202@psf.upfronthosting.co.za>
2014-08-15 00:29:59steven.dapranolinkissue22202 messages
2014-08-15 00:29:59steven.dapranocreate