Another fibonacci snippet

jasimp 0 Tallied Votes 147 Views Share

This one works pretty fast, even for large numbers. Like it says, aproxomite end number, and that is because it will generally go one fibonacci number above what you specify.

# Might need "raw_input("message")" to run 
d = input("Aproxomite End Number ")
a,b = 1,0
while b < d:
        sum = a + b
        a = b
        b = sum
        print b