I wrote a small module --
def fib(n): #write Fibonacci series up to n
a, b = 0, 1
while b < n:
print b,
a, b = b, b+a
def fib2(n): #return Fibonacci series up to n
result = []
a, b = 0, 1
while b < n:
result.append(b)
a, b = b, a+b
return result
Then I imported it into another script fibonacci.py
from fibo import fib
num = raw_input('Enter the value of N :: ')
print fib(num)
When I run fibonacci.py,the prompt asks me to enter the value of N. When I do so and press return, it starts printing numbers ans stuck in an infinite loop. The printing of numbers continues and continues...
What I might have been doing wrong?