"for n in range (num)",其中参数n是指Fib(n)中的n吗?为何n只在for循环语句中出现过一次?
"for n in range (num)",其中参数n是指Fib(n)中的n吗?为何n只在for循环语句中出现过一次?
class Fib(object):
def __init__(self, num):
a, b, L = 0, 1, []
for n in range(num):
L.append(a)
a, b = b, a + b
self.numbers = L