import itertools
def fib():
a, b = 0, 1
while True:
yield b
a, b = b, a+bprint sum(itertools.takewhile(lambda x: x < 400, fib)) ----------------------- I tried the above; and it worked too (986) Asokan Pichai _______________________________________________ BangPypers mailing list [email protected] https://mail.python.org/mailman/listinfo/bangpypers
