Here is my code to generate values in the fibonnacci sequence below 10,000,000.
3 fibs = [1,1] 4 while((x = fibs[-1] + fibs[-2]) <= 10000000): 5
from functools import partial from itertools import imap, islice, takewhile import operator fibs = [1, 1] for x in takewhile(partial(operator.ge, 10000000), imap(operator.add, fibs, islice(fibs, 1, None))): fibs.append(x)
Oh wait, you said "simplest"? Nevermind then.