Newbie errors :-( Need help
- C Saha -
p4sync at yahoo.com
Thu Mar 2 06:01:45 EST 2006
Hi All
I am getting the result but along with this error, any idea what could be the reason?
fibo.fib(1000)
1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987Traceback (most recent call last):
File "<interactive input>", line 1, in ?
File "fibo.py", line 8, in fib
return result
NameError: global name 'result' is not defined
Code is given below
------------------------------------
# Fibonacci numbers module
def fib(n): # write Fibonacci series up to n
a, b = 0, 1
while b < n:
print b,
a, b = b, a+b
return result
Thanks a lot to all in advance
====================
Thanks & Regards
CSaha
---------------------------------
Yahoo! Mail
Bring photos to life! New PhotoMail makes sharing a breeze.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060302/e9518f95/attachment.html>
More information about the Python-list
mailing list