Discuss / Python / 不能导入math库,不然这个代码是可以的,比较笨

不能导入math库,不然这个代码是可以的,比较笨

Topic source

菜问

#1 Created at ... [Delete] [Delete and Lock User]
    L, n, m = [], 1, 1
    while True :
        for i in range(m):
            i = i+1
            v = math.factorial(n-1)/(math.factorial(i-1)*math.factorial(n-i))
            L.append(int(v))
        m = m + 1
        n = m
        yield L
        L.clear()

  • 1

Reply