5.函数
定义函数 def fib2(n): # return Fibonacci series up to n """Return a list containing the Fibonacci series up to n.""" result = [] a, b = 0, 1 while a < n: result.append(a) # see below a, b = b, a+b return result ~ return 语句会从函数内部返回一个值 result.append(a) 语句调用了列表对