

def triangle(n):
    triangle=[[1],[1, 1]]
    columns=n
    for line in range(2,n):
        triangle.append([1])
        for column in range(1, line):
            triangle[line].append(triangle[line - 1][column - 1] + triangle[line - 1][column])
        triangle[line].append(1)
    return triangle
        
print(triangle(2))
print(triangle(4))
print(triangle(8))
