xs = [[1]] for n in range(1, 15): rs = [xs[n - 1][-1]] for i in range(n): rs.append(rs[i] + xs[n - 1][i]) xs.append(rs) print(xs)
To embed this program on your website, copy the following code and paste it into your website's HTML: