Mercurial > hg > euler
view problem2.py @ 14:49c96972949d default tip
#50 rewrite of solution
author | Dominic Cleal <dominic@computerkb.co.uk> |
---|---|
date | Mon, 01 Dec 2008 19:11:55 +0000 |
parents | 1ca695e32f66 |
children |
line wrap: on
line source
tot = 2 f = [ 1, 2 ] while True: f.append(f[0] + f[1]) f.pop(0) f.append(f[0] + f[1]) f.pop(0) e = f[0] + f[1] if e>4000000: break tot += e f.append(e) f.pop(0) print tot