My solutions to the problems found at Project Euler.
Jump to: | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 20 | 21 | 22 | 25 | 3-2 |def ffwnd(n):
""" Finds the first fibonaci number with n digits. """
if n <= 0: return None
if n == 1: return 1
prev = [1,2]
counter = 3
while len(str(prev[1])) <= n-1:
prev.append(prev[0] + prev[1])
del prev[0]
counter += 1
return (counter, prev[1])
if __name__ == "__main__":
print ffwnd(1000)