a=b a= a+b 结果不对啊????
class Fib(object):
def __init__(self, num):
n = 0
y = 1
self.listf = []
for x in range(num):
self.listf.append(n)
y = n + y
n = y
def __str__(self):
return str(self.listf)
__repr__ = __str__
def __len__(self):
return len(self.listf)
f = Fib(10)
print f
print len(f)