Haulien icon

fibonacci generator

Haulien | PRO | 10/30/11 05:33:52 AM UTC | 0 ⭐ | 320 👁️ | Never ⏰ | []
Python |

250 B

|

None

|

0 👍

/

0 👎

def fib(n):     # write Fibonacci series up to n
    a, b = 0, 1
    while b < n:    
        ## TO DO : Add b to result list
        a, b = b, a+b
        print b
        
    
 
maxNumberToGenerate = 500000000
 
fib(maxNumberToGenerate)

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎