Ticket #6000: pyfib.py

File pyfib.py, 191 bytes (added by guest, 2 years ago)

Python implementation

Line 
1
2def fib(n):
3    one = 0
4    two = 1
5    for i in range(0,n):
6        temp = two
7        two = one + two
8        one = temp
9    return two
10
11if __name__ == "__main__":
12    print fib(1000000);