repl.it
@panniu/

test-1

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from math import *

"""
1
11
121
1331
14641

"""



rep = 20
a = [[1],[1,1]]


for x in range(rep-2):
	a.append([])
	a[x+2].append(1)
	for y in range(len(a)-2):
		a[x+2].append(a[x+1][y]+a[x+1][y+1])
	a[x+2].append(1)

leng = len(" ".join(map(str,a[-1])))

for i,x in enumerate(a):
	le = len(" ".join(map(str,a[i])))
	print(" "*int((leng-le)/2),end="")
	for y in x:
		print(str(y) + " ",end="")
	print()

Fetching token
?