Discuss / Python / 交作业,有没有大神评论下!

交作业,有没有大神评论下!

Topic source

木四水华

#1 Created at ... [Delete] [Delete and Lock User]
def triangles():    L=[1]    yield L    L=[1,1]    while True:        yield L        L1 = []        for i in range(0,len(L)-1):            L1 = [L[i]+L[i+1]]+L1        L=[1]+L1+[1]

木四水华

#2 Created at ... [Delete] [Delete and Lock User]
def triangles():
  L=[1]
  yield L  L=[1,1]  while True:    yield L
    L1 = []      for i in range(0,len(L)-1):
        L1 = [L[i]+L[i+1]]+L1
      L=[1]+L1+[1]

  • 1

Reply