#! /usr/local/bin/python3 def fibo(n): a, b = 0, 1 for _ in range(n): yield a a, b = b, a+b print(list(fibo(20)))