#!/usr/bin/env python3
# -- coding: utf-8 --
# @Date : 2018-07-12 22:48:30
# @Author : Simon (simon.xie@codewalker.meg)
# @Link : http://www.codewalker.me
# @Version : 1.0.0
def fib_num_generator():
a, b = 0, 1
while True:
a, b = b, a + b
yield a
def main():
f = fib_num_generator()
fib_list = []
for _ in range(10):
fib_list.append(next(f))
print(fib_list)
if __name__ == “__main__“:
main()