def fib(): """ 1,1,2,3,5,8,13,21.... :return: """ a = 0 b = 1 while True: a, b = b, a+b yield afor each in fib(): if each > 50: break print(each)