标签:bubuko ima 实现 val .com pytho for image one
def fib(num):
a = 0
b = 1
n = 0
while n < num:
a, b = b , a + b
yield a
n += 1
print('done')
for i in fib(9):
print(i)
print(fib(9))
def triangles(num):
l = []
n = 0
c = 0
while n < num:
b = 0
result = []
if len(l):
for x in l[:]:
result.append(b + x)
b = x
l = result[:]
l.append(1)
yield l
n += 1
print('done')
for val in triangles(9):
print(val)
标签:bubuko ima 实现 val .com pytho for image one
原文地址:https://www.cnblogs.com/tonymin/p/9839503.html