python yield 实现斐波那契数列 def FB(n): a,b=0,1 while n>0: yield b a,b=b,a+b n-=1 def FB2(n): return list(FB(n))