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
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
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.
-- http://mail.python.org/mailman/listinfo/python-list