请问下, 这样写为什么不能全部输出呢?
class Fib(object):
L = []
n = 2
def __init__(self, num):
self.num = num
Fib.L.append(0)
Fib.L.append(1)
while Fib.n < self.num:
Fib.L.append(Fib.L[Fib.n-1] + Fib.L[Fib.n-2])
Fib.n += 1
def __str__(self):
for x in Fib.L:
return '%s' %x
__repr__ = __str__
def __len__(self):
return len(Fib.L)
f = Fib(10)
print f
print len(f)